]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix memory leak in share mode locking.
authorHemanth Thummala <hemanth.thummala@nutanix.com>
Wed, 25 May 2016 06:15:04 +0000 (23:15 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 31 May 2016 06:58:21 +0000 (08:58 +0200)
Not freeing up(and reparenting to NULL context) ndr buffer
used for TDB updates resulting in huge memory leak when there
in high volume of opens and closes happening on same object.

Free the buffer before reparenting its parent to NULL context.

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

Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Signed-off-by: Saji VR <saji.vr@nutanix.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri May 27 18:43:31 CEST 2016 on sn-devel-144

(cherry picked from commit 7a725eea25f905fc5f611e8f3d7cfe414d5cf913)

source3/locking/share_mode_lock.c

index fe105e3900af73dd23a4f05eaa8a2b2d7797b934..4e9de036c715e61e18e738f95118196866564c04 100644 (file)
@@ -440,6 +440,11 @@ static int share_mode_data_destructor(struct share_mode_data *d)
         */
        TALLOC_FREE(d->record);
 
+       /*
+        * Release the dptr as well before reparenting to NULL
+        * (in-memory cache) context.
+        */
+       TALLOC_FREE(data.dptr);
        /*
         * Reparent d into the in-memory cache so it can be reused if the
         * sequence number matches. See parse_share_modes()