From fbdde5eda3f69a87023908dd0e5c9c7333a63098 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Nov 2017 00:09:39 +0000 Subject: [PATCH] s3: utils: net. Fix return paths that don't free talloc stackframe. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13151 Signed-off-by: Jeremy Allison --- source3/utils/net_usershare.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index 78d38daaf97..8357296f727 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -647,13 +647,16 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) us_comment = ""; arg_acl = "S-1-1-0:R"; - if (c->display_usage) + if (c->display_usage) { + TALLOC_FREE(ctx); return net_usershare_add_usage(c, argc, argv); + } switch (argc) { case 0: case 1: default: + TALLOC_FREE(ctx); return net_usershare_add_usage(c, argc, argv); case 2: cp_sharename = argv[0]; -- 2.15.0.448.gf294e3d99a-goog