tdb: Fix CID 1034959 Uninitialized scalar variable
authorVolker Lendecke <vl@samba.org>
Sat, 22 Jun 2013 10:13:26 +0000 (12:13 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 22 Jul 2013 22:07:21 +0000 (15:07 -0700)
log_ctx.log_private was used uninitialized. Not a real bug here,
as tdb_log does not access it, but tdb_open_ex still moves around
uninitialized data. So this would show up in valgrind as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tdb/tools/tdbtool.c

index 3f870d46680e3d5ecac24fdb42682a2d49414801..01b9a14cc1f2b6d65fe03e802b33f7c004e6af36 100644 (file)
@@ -222,7 +222,7 @@ static void terror(const char *why)
 
 static void create_tdb(const char *tdbname)
 {
-       struct tdb_logging_context log_ctx;
+       struct tdb_logging_context log_ctx = { NULL, NULL};
        log_ctx.log_fn = tdb_log;
 
        if (tdb) tdb_close(tdb);