commit | 14b322b25178850f9c1ea322e9daf95df4479af0 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Tue Dec 12 16:39:01 2023 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Dec 12 16:39:01 2023 +0000 |
tree | 6dc7d86d797e197c441650bc420a1b9297640085 | |
parent | 00ab1a5f95cdf3dd12a382e37fe7ed7ce9ba5d7f [diff] | |
parent | 12f8ec4004b5f479a74c0297729ee0c6e3f8cd6e [diff] |
Merge "Closing the stream when the function returns" into main
diff --git a/libc/dns/net/sethostent.c b/libc/dns/net/sethostent.c index 483105a..5c4bdb5 100644 --- a/libc/dns/net/sethostent.c +++ b/libc/dns/net/sethostent.c
@@ -157,6 +157,7 @@ if ((ptr = buf = malloc(len = info->buflen)) == NULL) { *info->he = NETDB_INTERNAL; + endhostent_r(&hf); return NULL; } @@ -241,6 +242,7 @@ return hp; nospc: *info->he = NETDB_INTERNAL; + endhostent_r(&hf); free(buf); errno = ENOSPC; return NULL;