diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-06-01 06:59:21 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-06-07 11:31:15 +1000 |
commit | 1527d9f61e6d50f6c2b4a3fa5b45829034b1b0b1 (patch) | |
tree | 72053204fdde1b368201b01a94f7184532817661 /bitmap.c | |
parent | cc812baf39b93d5355565da98648d8c31f955990 (diff) |
upstream commit
no need to bzero allocated space now that we use use
recallocarray; ok deraadt@
Upstream-ID: 53333c62ccf97de60b8cb570608c1ba5ca5803c8
Diffstat (limited to 'bitmap.c')
-rw-r--r-- | bitmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -87,10 +87,10 @@ reserve(struct bitmap *b, u_int n) | |||
87 | return -1; /* invalid */ | 87 | return -1; /* invalid */ |
88 | nlen = (n / BITMAP_BITS) + 1; | 88 | nlen = (n / BITMAP_BITS) + 1; |
89 | if (b->len < nlen) { | 89 | if (b->len < nlen) { |
90 | if ((tmp = recallocarray(b->d, b->len, nlen, BITMAP_BYTES)) == NULL) | 90 | if ((tmp = recallocarray(b->d, b->len, |
91 | nlen, BITMAP_BYTES)) == NULL) | ||
91 | return -1; | 92 | return -1; |
92 | b->d = tmp; | 93 | b->d = tmp; |
93 | memset(b->d + b->len, 0, (nlen - b->len) * BITMAP_BYTES); | ||
94 | b->len = nlen; | 94 | b->len = nlen; |
95 | } | 95 | } |
96 | return 0; | 96 | return 0; |