]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Fix CID 1467087: Resource leaks
authorVolker Lendecke <vl@samba.org>
Tue, 22 Sep 2020 11:55:19 +0000 (13:55 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 23 Sep 2020 18:20:36 +0000 (18:20 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 23 18:20:36 UTC 2020 on sn-devel-184

source3/libsmb/namequery.c

index 1812e9b8bd0bd197f7c2982043ba7f7777749760..cd4a31fd8c9fdbb128501527f7ec49d8dacc6ac2 100644 (file)
@@ -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;