From 08c4dd586fc69051ab121071a95d6e18f85c290b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 22 Sep 2020 13:55:19 +0200 Subject: [PATCH] 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 --- source3/libsmb/namequery.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.3