summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/tdb/tdbutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 409397366a..0a2f1f84d4 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -292,7 +292,10 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...)
len = 4;
if (bufsize < len) goto no_space;
*i = IVAL(buf, 0);
- if (! *i) break;
+ if (! *i) {
+ *b = NULL;
+ break;
+ }
len += *i;
if (bufsize < len) goto no_space;
*b = (char *)malloc(*i);