mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
libsmb: fix leak in opendir error path
Fixes CID 242325 - dir state and the talloc frame are leaked on user_auth_info_init() failure. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 26 00:58:41 CEST 2016 on sn-devel-144
This commit is contained in:
parent
ca5e109353
commit
84786c8305
@ -485,6 +485,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
|
||||
|
||||
u_info = user_auth_info_init(frame);
|
||||
if (u_info == NULL) {
|
||||
if (dir) {
|
||||
SAFE_FREE(dir->fname);
|
||||
SAFE_FREE(dir);
|
||||
}
|
||||
TALLOC_FREE(frame);
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
set_cmdline_auth_info_username(u_info, user);
|
||||
|
Loading…
Reference in New Issue
Block a user