source3/utils/net_conf.c: fix stackframe leak
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:39:31 +0000 (05:09 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:39:31 +0000 (05:09 +0930)
net_conf_wrap_function() doesn't free its stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/utils/net_conf.c

index b257ce17869c7499011a2662d8031ad016d2ff2c..60588c0eedce965e9a0f856862f24a03a11f64cb 100644 (file)
@@ -1131,6 +1131,7 @@ static int net_conf_wrap_function(struct net_context *c,
 
        err = smbconf_init(mem_ctx, &conf_ctx, "registry:");
        if (!SBC_ERROR_IS_OK(err)) {
+               talloc_free(mem_ctx);
                return -1;
        }
 
@@ -1138,6 +1139,7 @@ static int net_conf_wrap_function(struct net_context *c,
 
        smbconf_shutdown(conf_ctx);
 
+       talloc_free(mem_ctx);
        return ret;
 }