Correct "allready" typos.
[nivanova/samba-autobuild/.git] / source3 / smbd / ntquotas.c
index 9b2e39a72bf8e1e0d702f693202fcd5268388fb9..8a44f7c674a4ef7b761a068ef2d1c4e8e859a05e 100644 (file)
@@ -139,7 +139,7 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid
        return ret;
 }
 
-static bool allready_in_quota_list(SMB_NTQUOTA_LIST *qt_list, uid_t uid)
+static bool already_in_quota_list(SMB_NTQUOTA_LIST *qt_list, uid_t uid)
 {
        SMB_NTQUOTA_LIST *tmp_list = NULL;
        
@@ -179,8 +179,8 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list)
 
                ZERO_STRUCT(tmp_qt);
 
-               if (allready_in_quota_list((*qt_list),usr->pw_uid)) {
-                       DEBUG(5,("record for uid[%ld] allready in the list\n",(long)usr->pw_uid));
+               if (already_in_quota_list((*qt_list),usr->pw_uid)) {
+                       DEBUG(5,("record for uid[%ld] already in the list\n",(long)usr->pw_uid));
                        continue;
                }
 
@@ -226,13 +226,15 @@ 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;
 }
 
 static int quota_handle_destructor(SMB_NTQUOTA_HANDLE *handle)
 {
-       if (handle->quota_list)
-               free_ntquota_list(&handle->quota_list);
+       free_ntquota_list(&handle->quota_list);
        return 0;
 }