diff options
author | Damien Miller <djm@mindrot.org> | 2022-12-09 18:00:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2022-12-09 18:00:50 +1100 |
commit | ea6fdf9a1aa71a411f7db218a986392c4fb55693 (patch) | |
tree | 72c607b3c03ac25f158e5eec096dcb4565193031 /openbsd-compat | |
parent | 4403b62f5548e91389cb3339d26a9d0c4bb07b34 (diff) | |
download | openssh-git-ea6fdf9a1aa71a411f7db218a986392c4fb55693.tar.gz |
use calloc for allocating arc4random structs
ok dtucker
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/arc4random.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/arc4random.h b/openbsd-compat/arc4random.h index 01629752..5af3a449 100644 --- a/openbsd-compat/arc4random.h +++ b/openbsd-compat/arc4random.h @@ -75,9 +75,9 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) return (-1); } #else - if ((*rsp = malloc(sizeof(**rsp))) == NULL) + if ((*rsp = calloc(1, sizeof(**rsp))) == NULL) return (-1); - if ((*rsxp = malloc(sizeof(**rsxp))) == NULL) { + if ((*rsxp = calloc(1, sizeof(**rsxp))) == NULL) { free(*rsp); *rsp = NULL; return (-1); |