diff options
author | Volker Lendecke <vl@samba.org> | 2016-12-27 12:21:09 +0000 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2016-12-28 20:17:12 +0100 |
commit | 2146df24d86eff3cbe6ca713db3bee546f2c7de7 (patch) | |
tree | d12a791aa60bf253a1ab52fc6290ada217ae8497 /source4/winbind/idmap.c | |
parent | f39ed433dc6393e82e82ad734a79473abe01ee75 (diff) | |
download | samba-2146df24d86eff3cbe6ca713db3bee546f2c7de7.tar.gz |
idmap4: Fix error path memleaks in idmap_init
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source4/winbind/idmap.c')
-rw-r--r-- | source4/winbind/idmap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c index 578a7c303c9..6f701f04621 100644 --- a/source4/winbind/idmap.c +++ b/source4/winbind/idmap.c @@ -171,28 +171,31 @@ struct idmap_context *idmap_init(TALLOC_CTX *mem_ctx, system_session(lp_ctx), NULL, 0); if (idmap_ctx->ldb_ctx == NULL) { - return NULL; + goto fail; } idmap_ctx->unix_groups_sid = dom_sid_parse_talloc( idmap_ctx, "S-1-22-2"); if (idmap_ctx->unix_groups_sid == NULL) { - return NULL; + goto fail; } idmap_ctx->unix_users_sid = dom_sid_parse_talloc( idmap_ctx, "S-1-22-1"); if (idmap_ctx->unix_users_sid == NULL) { - return NULL; + goto fail; } idmap_ctx->samdb = samdb_connect(idmap_ctx, ev_ctx, lp_ctx, system_session(lp_ctx), 0); if (idmap_ctx->samdb == NULL) { DEBUG(0, ("Failed to load sam.ldb in idmap_init\n")); - return NULL; + goto fail; } return idmap_ctx; +fail: + TALLOC_FREE(idmap_ctx); + return NULL; } /** |