From bc3261f0c52847515bfdc35856f903c3be61c72e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 19 Jun 2011 11:26:55 +0200 Subject: [PATCH] s3: Fix a memleak in name_resolve_bcast Autobuild-User: Volker Lendecke Autobuild-Date: Sun Jun 19 12:40:55 CEST 2011 on sn-devel-104 --- source3/libsmb/namequery.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index dc062fb0a0c..988840ad947 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1768,6 +1768,7 @@ NTSTATUS name_resolve_bcast(const char *name, { struct sockaddr_storage *bcast_addrs; int i, num_addrs, num_bcast_addrs; + NTSTATUS status; if (lp_disable_netbios()) { DEBUG(5,("name_resolve_bcast(%s#%02x): netbios is disabled\n", @@ -1805,10 +1806,12 @@ NTSTATUS name_resolve_bcast(const char *name, num_bcast_addrs += 1; } - return name_queries(name, name_type, true, true, - bcast_addrs, num_bcast_addrs, 0, 1000, - mem_ctx, return_iplist, return_count, - NULL, NULL); + status = name_queries(name, name_type, true, true, + bcast_addrs, num_bcast_addrs, 0, 1000, + mem_ctx, return_iplist, return_count, + NULL, NULL); + TALLOC_FREE(bcast_addrs); + return status; } struct query_wins_list_state { -- 2.11.4.GIT