1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

smbd: free talloc context if no quota records are available

When generating a list of user quota records, free the memory
context that controls this list if the list is empty. Otherwise,
the context remains unreferenced and memory is leaked.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12289

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Uri Simchoni
2016-09-18 11:05:23 +03:00
committed by Jeremy Allison
parent dad6c2d563
commit 175bc6f1e3

View File

@ -226,6 +226,9 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list)
}
endpwent();
if (*qt_list == NULL) {
TALLOC_FREE(mem_ctx);
}
return 0;
}