Memory leak var «name»: line 2536 in function «winbind_upn_to_username» https://gitlab.com/samba-team/samba/-/blob/master/nsswitch/pam_winbind.c?ref_type=heads#L2536 ``` /* Convert the SID back to the sAMAccountName */ wbc_status = wbcCtxLookupSid(ctx->wbc_ctx, &sid, &domain, &name, &type); ``` in function «wbcCtxLookupSid» on line 297 the pointer is being erased
Created attachment 18509 [details] Does that help?
Comment on attachment 18509 [details] Does that help? No. After call func "wbcCtxLookupName" var "name" has a new pointer value. Help save value "name" in "name_save" before call func "wbcCtxLookupName". After ``` wbcFreeMemory(name); +++ if (name != name_save) wbcFreeMemory(name_save); ```
(In reply to Volker Lendecke from comment #1) Oh sorry. This really help.
(In reply to prohorp from comment #2) this is an option to release resources at the end of the function
This bug was referenced in samba master: 7e8bfe738a3d91b0724d57ed54acf40ebe026c14
Created attachment 18514 [details] Patch works against 4.21 and 4.20
Comment on attachment 18514 [details] Patch works against 4.21 and 4.20 LGTM, RB+, thanks!
Jule, please add to 4.20 and 4.21
Pushed to autobuild-v4-{21,20}-test.
This bug was referenced in samba v4-21-test: 7202467477de13e9c960677de6792ec42f92ac0c
This bug was referenced in samba v4-20-test: 4d043ea5e51904ab701d87d93f235dd989a08d6a
Closing out bug report. Thanks!
This bug was referenced in samba v4-21-stable (Release samba-4.21.3): 7202467477de13e9c960677de6792ec42f92ac0c