1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

Release still reachable memory if the smbclient context is freed.

Signed-off-by: Andreas Schneider <anschneider@suse.de>
(This used to be commit 7a65053bc8)
This commit is contained in:
Andreas Schneider
2008-07-15 14:57:32 +02:00
committed by Jeremy Allison
parent 4d1979423e
commit 525a3f3c49

View File

@ -200,6 +200,22 @@ smbc_free_context(SMBCCTX *context,
smbc_setUser(context, NULL);
DEBUG(3, ("Context %p successfully freed\n", context));
gfree_names();
gfree_loadparm();
gfree_case_tables();
gfree_charcnv();
gfree_interfaces();
gencache_shutdown();
secrets_shutdown();
/* release the talloc null_context memory last */
talloc_disable_null_tracking();
gfree_debugsyms();
SAFE_FREE(context->internal);
SAFE_FREE(context);
return 0;
}
@ -411,6 +427,9 @@ smbc_init_context(SMBCCTX *context)
char *user = NULL;
char *home = NULL;
/* track talloc null_context memory */
talloc_enable_null_tracking();
if (!context) {
errno = EBADF;
return NULL;