summaryrefslogtreecommitdiff
path: root/source3/smbd/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/session.c')
-rw-r--r--source3/smbd/session.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index 27f760a088..41f8fd0ed4 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -224,6 +224,10 @@ static int gather_sessioninfo(TDB_CONTEXT *stdb, TDB_DATA kbuf, TDB_DATA dbuf,
sesslist->count += 1;
sesslist->sessions = SMB_REALLOC_ARRAY(sesslist->sessions, struct sessionid,
sesslist->count);
+ if (!sesslist->sessions) {
+ sesslist->count = 0;
+ return -1;
+ }
memcpy(&sesslist->sessions[sesslist->count - 1], current,
sizeof(struct sessionid));