From 1ef468f805d415e587e2f9a242fa934670ea9330 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Sep 2001 11:44:25 +0000 Subject: Fix the uninitialised variable, but more importantly fix the SEGFAULT. Merge for 2.2.2 Should TDB cope with TDB pointers itself? Andrew Bartlett (This used to be commit 27f0510a0b458792293d5ce2957f61383569f62f) --- source3/passdb/pdb_tdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 8ec0e82c3e..6702926355 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -727,7 +727,7 @@ BOOL pdb_delete_sam_account(char *sname) static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag) { - TDB_CONTEXT *pwd_tdb; + TDB_CONTEXT *pwd_tdb = NULL; TDB_DATA key, data; uint8 *buf = NULL; fstring keystr; @@ -780,7 +780,7 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag) if (!pwd_tdb) { DEBUG(0, ("Unable to create TDB passwd (passdb.tdb) !!!\n")); ret = False; - goto done; + goto reallydone; } newtdb = True; } @@ -816,6 +816,8 @@ done: /* cleanup */ tdb_close (pwd_tdb); + +reallydone: SAFE_FREE(buf); return (ret); } -- cgit