summaryrefslogtreecommitdiff
path: root/source/smbd/ntquotas.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/ntquotas.c')
-rw-r--r--source/smbd/ntquotas.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/source/smbd/ntquotas.c b/source/smbd/ntquotas.c
index c616c494dc..fcccf9d9fc 100644
--- a/source/smbd/ntquotas.c
+++ b/source/smbd/ntquotas.c
@@ -222,13 +222,6 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list)
return 0;
}
-static int quota_handle_destructor(SMB_NTQUOTA_HANDLE *handle)
-{
- if (handle->quota_list)
- free_ntquota_list(&handle->quota_list);
- return 0;
-}
-
void *init_quota_handle(TALLOC_CTX *mem_ctx)
{
SMB_NTQUOTA_HANDLE *qt_handle;
@@ -242,6 +235,24 @@ void *init_quota_handle(TALLOC_CTX *mem_ctx)
return NULL;
}
- talloc_set_destructor(qt_handle, quota_handle_destructor);
- return (void *)qt_handle;
+ return (void *)qt_handle;
+}
+
+void destroy_quota_handle(void **pqt_handle)
+{
+ SMB_NTQUOTA_HANDLE *qt_handle = NULL;
+ if (!pqt_handle||!(*pqt_handle))
+ return;
+
+ qt_handle = (SMB_NTQUOTA_HANDLE *)(*pqt_handle);
+
+
+ if (qt_handle->quota_list)
+ free_ntquota_list(&qt_handle->quota_list);
+
+ qt_handle->quota_list = NULL;
+ qt_handle->tmp_list = NULL;
+ qt_handle = NULL;
+
+ return;
}