Check the correct variables for malloc failures.
Submitted by: Michiel Boland <michiel@boland.org>
This commit is contained in:
parent
56e4ceea65
commit
96e460ec53
@ -388,7 +388,7 @@ create_service(struct netconfig *nconf)
|
||||
break;
|
||||
case AF_INET6:
|
||||
sin6 = malloc(sizeof(struct sockaddr_in6));
|
||||
if (res->ai_addr == NULL)
|
||||
if (sin6 == NULL)
|
||||
out_of_mem();
|
||||
sin6->sin6_family = AF_INET6;
|
||||
sin6->sin6_port = htons(0);
|
||||
|
@ -330,7 +330,7 @@ create_service(struct netconfig *nconf)
|
||||
break;
|
||||
case AF_INET6:
|
||||
sin6 = malloc(sizeof(struct sockaddr_in6));
|
||||
if (res->ai_addr == NULL)
|
||||
if (sin6 == NULL)
|
||||
out_of_mem();
|
||||
sin6->sin6_family = AF_INET6;
|
||||
sin6->sin6_port = htons(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user