Check the correct variables for malloc failures.

Submitted by:	Michiel Boland <michiel@boland.org>
This commit is contained in:
Matteo Riondato 2007-11-07 10:21:36 +00:00
parent 56e4ceea65
commit 96e460ec53
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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);