diff options
author | Volker Lendecke <vl@samba.org> | 2008-03-29 18:19:31 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-16 23:18:50 +0200 |
commit | e58729f0eaefb5659396f7f0ecb6239806ee275f (patch) | |
tree | 6e2371f524858c6afb26e2ce7174a8fc048871c3 /source3/smbd/ntquotas.c | |
parent | 08971abdad82ce6b57a85ce77a8cb7906b0dab2f (diff) | |
download | samba-e58729f0eaefb5659396f7f0ecb6239806ee275f.tar.gz samba-e58729f0eaefb5659396f7f0ecb6239806ee275f.tar.bz2 samba-e58729f0eaefb5659396f7f0ecb6239806ee275f.zip |
Simplify fake_file logic
(This used to be commit 93111ea0a1191e8547ad6cf112e2699d3bb3799b)
Diffstat (limited to 'source3/smbd/ntquotas.c')
-rw-r--r-- | source3/smbd/ntquotas.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c index fcccf9d9fc..c616c494dc 100644 --- a/source3/smbd/ntquotas.c +++ b/source3/smbd/ntquotas.c @@ -222,6 +222,13 @@ 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; @@ -235,24 +242,6 @@ void *init_quota_handle(TALLOC_CTX *mem_ctx) return NULL; } - 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; + talloc_set_destructor(qt_handle, quota_handle_destructor); + return (void *)qt_handle; } |