1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

Fix memory leak in share mode locking.

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
This commit is contained in:
Hemanth Thummala 2016-05-24 23:15:04 -07:00 committed by Volker Lendecke
parent 1b3b893454
commit 7a725eea25

View File

@ -440,6 +440,11 @@ static int share_mode_data_destructor(struct share_mode_data *d)
*/ */
TALLOC_FREE(d->record); 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 * Reparent d into the in-memory cache so it can be reused if the
* sequence number matches. See parse_share_modes() * sequence number matches. See parse_share_modes()