Author: tridge
Date: 2004-10-11 05:17:21 +0000 (Mon, 11 Oct 2004)
New Revision: 2906

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/client&rev=2906&nolog=1

Log:
fixed a memory leak in the smbclient -L code



Modified:
   branches/SAMBA_4_0/source/client/client.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===================================================================
--- branches/SAMBA_4_0/source/client/client.c   2004-10-11 05:07:31 UTC (rev 2905)
+++ branches/SAMBA_4_0/source/client/client.c   2004-10-11 05:17:21 UTC (rev 2906)
@@ -2229,6 +2229,7 @@
                talloc_destroy(mem_ctx);
                return False;
        }
+       talloc_steal(mem_ctx, p);
 
        r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p));
        r.in.level = 1;
@@ -2252,10 +2253,11 @@
                }
        } while (NT_STATUS_IS_OK(status) && W_ERROR_EQUAL(r.out.result, 
WERR_MORE_DATA));
 
+       talloc_destroy(mem_ctx);
+
        if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
                d_printf("Failed NetShareEnumAll %s - %s/%s\n", 
                         binding, nt_errstr(status), win_errstr(r.out.result));
-               talloc_destroy(mem_ctx);
                return False;
        }
 

Reply via email to