X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=source3%2Flibsmb%2Flibsmb_context.c;h=114f775086bd224f4238a2d93ff1828e57158986;hp=51948d16487b8673cd768821d4d6629d5c9a60c4;hb=525a3f3c491ae83feb94bc2d7e1979643641166d;hpb=4d1979423e6f73954ca594197634fde563ef80f5;ds=sidebyside diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index 51948d16487..114f775086b 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;