summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_context.c
diff options
context:
space:
mode:
authorAndreas Schneider <anschneider@suse.de>2008-07-15 14:57:32 +0200
committerJeremy Allison <jra@samba.org>2008-07-15 17:13:17 -0700
commit525a3f3c491ae83feb94bc2d7e1979643641166d (patch)
tree784bc4fcc8c43ac7ab9daba40075ffca90aee3fa /source3/libsmb/libsmb_context.c
parent4d1979423e6f73954ca594197634fde563ef80f5 (diff)
downloadsamba-525a3f3c491ae83feb94bc2d7e1979643641166d.tar.gz
samba-525a3f3c491ae83feb94bc2d7e1979643641166d.tar.bz2
samba-525a3f3c491ae83feb94bc2d7e1979643641166d.zip
Release still reachable memory if the smbclient context is freed.
Signed-off-by: Andreas Schneider <anschneider@suse.de> (This used to be commit 7a65053bc8579b4f56045fb2c658a91a4af0dfea)
Diffstat (limited to 'source3/libsmb/libsmb_context.c')
-rw-r--r--source3/libsmb/libsmb_context.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index 51948d1648..114f775086 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -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;