mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-12-23 02:12:12 +00:00
upstream commit
no need to bzero allocated space now that we use use recallocarray; ok deraadt@ Upstream-ID: 53333c62ccf97de60b8cb570608c1ba5ca5803c8
This commit is contained in:
parent
cc812baf39
commit
1527d9f61e
4
bitmap.c
4
bitmap.c
@ -87,10 +87,10 @@ reserve(struct bitmap *b, u_int n)
|
|||||||
return -1; /* invalid */
|
return -1; /* invalid */
|
||||||
nlen = (n / BITMAP_BITS) + 1;
|
nlen = (n / BITMAP_BITS) + 1;
|
||||||
if (b->len < nlen) {
|
if (b->len < nlen) {
|
||||||
if ((tmp = recallocarray(b->d, b->len, nlen, BITMAP_BYTES)) == NULL)
|
if ((tmp = recallocarray(b->d, b->len,
|
||||||
|
nlen, BITMAP_BYTES)) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
b->d = tmp;
|
b->d = tmp;
|
||||||
memset(b->d + b->len, 0, (nlen - b->len) * BITMAP_BYTES);
|
|
||||||
b->len = nlen;
|
b->len = nlen;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user