summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-09-26 11:44:25 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-09-26 11:44:25 +0000
commit1ef468f805d415e587e2f9a242fa934670ea9330 (patch)
treef5aee696d00ce5515893db4bb9072fdba42ab70c /source3
parentf12ebc00a847e5d38e0a591e8958c4e71f2c2842 (diff)
downloadsamba-1ef468f805d415e587e2f9a242fa934670ea9330.tar.gz
samba-1ef468f805d415e587e2f9a242fa934670ea9330.tar.bz2
samba-1ef468f805d415e587e2f9a242fa934670ea9330.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_tdb.c6
1 files changed, 4 insertions, 2 deletions
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);
}