From: Volker Lendecke Date: Tue, 22 Sep 2020 11:55:19 +0000 (+0200) Subject: libsmb: Fix CID 1467087: Resource leaks X-Git-Tag: talloc-2.3.2~449 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08c4dd586fc69051ab121071a95d6e18f85c290b;p=thirdparty%2Fsamba.git libsmb: Fix CID 1467087: Resource leaks Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Sep 23 18:20:36 UTC 2020 on sn-devel-184 --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 1812e9b8bd0..cd4a31fd8c9 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2836,6 +2836,7 @@ static NTSTATUS resolve_hosts(TALLOC_CTX *mem_ctx, /* wrap check. */ if (ret_count + 1 < ret_count) { freeaddrinfo(ailist); + TALLOC_FREE(iplist); return NT_STATUS_INVALID_PARAMETER; } ret_count += 1; @@ -2846,6 +2847,7 @@ static NTSTATUS resolve_hosts(TALLOC_CTX *mem_ctx, if (tmp == NULL) { DEBUG(3,("resolve_hosts: malloc fail !\n")); freeaddrinfo(ailist); + TALLOC_FREE(iplist); return NT_STATUS_NO_MEMORY; } iplist = tmp;