mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 17:29:59 -04:00
Add missing malloc failure check
Correctly NULL second entry in he->h_addr_list on get*byaddr.
This commit is contained in:
parent
60e0b5df02
commit
c4cc75482f
1 changed files with 3 additions and 1 deletions
|
|
@ -625,11 +625,13 @@ hostfromaddr(lwres_gnbaresponse_t *addr, int af, const void *src) {
|
|||
|
||||
/* copy address */
|
||||
he->h_addr_list = malloc(sizeof(char *) * 2);
|
||||
if (he->h_addr_list == NULL)
|
||||
goto cleanup;
|
||||
he->h_addr_list[0] = malloc(he->h_length);
|
||||
if (he->h_addr_list[0] == NULL)
|
||||
goto cleanup;
|
||||
memcpy(he->h_addr_list[0], src, he->h_length);
|
||||
he->h_addr_list[i] = NULL;
|
||||
he->h_addr_list[1] = NULL;
|
||||
return (he);
|
||||
|
||||
cleanup:
|
||||
|
|
|
|||
Loading…
Reference in a new issue