mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:smbd: fix SAFE_FREE() vs. TALLOC_FREE() in list_sessions()
It's very unlikely that sessionid_traverse_read() fails, but we should not segfault. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
7dbd8e441f
commit
4c6156eddd
@ -179,8 +179,8 @@ int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list)
|
||||
|
||||
status = sessionid_traverse_read(gather_sessioninfo, (void *) &sesslist);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(3, ("Session traverse failed\n"));
|
||||
SAFE_FREE(sesslist.sessions);
|
||||
DBG_ERR("Session traverse failed: %s\n", nt_errstr(status));
|
||||
TALLOC_FREE(sesslist.sessions);
|
||||
*session_list = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user