From: Hemanth Thummala <hemanth.thummala@nutanix.com>
To: Jeremy Allison <jra@samba.org>, Richard Sharpe <richard.sharpe@nutanix.com>
CC: Saji VR <saji.vr@nutanix.com>
Subject: Re: Memory leak while doing notify cancel?
Hi Jeremy,
Thank you for suggesting the patch to address the leak in smb_request. We have actually tested further with this fix and iden
+tified(by Saji) that we still have a leak in notify_mid_map structure.
From what I understood is that when destructor returns -1 and already reparented, we are returning from the while loop withou
+t traversing the remaining children. This is leaving the notify_mid_map structure as detached child and never get a chance t
+o free.
We have verified that the following patch(by Saji) actually fixed the leak in notify_mid_map structure.
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -1475,7 +1475,7 @@ static inline void _talloc_free_children_internal(struct talloc_chunk *tc,
* Destructor already reparented this child.
* No further reparenting needed.
*/
- return;
+ continue;
}
if (new_parent == null_context) {
struct talloc_chunk *p = talloc_parent_chunk(ptr);
We would like to know if our understanding is correct.
Thanks,
Hemanth.