mirror of
https://github.com/samba-team/samba.git
synced 2025-10-24 15:33:20 +03:00
ntquotas: support "freeing" an empty quota list
This avoids dereferencing a null pointer if there's an attempt to free an empty list. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12307 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
610c26d74c
commit
dd8a0578d8
@@ -34,8 +34,9 @@ NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum)
|
||||
|
||||
void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list)
|
||||
{
|
||||
if (!qt_list)
|
||||
if (!qt_list || !*qt_list) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*qt_list)->mem_ctx)
|
||||
talloc_destroy((*qt_list)->mem_ctx);
|
||||
|
||||
Reference in New Issue
Block a user