diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clirap2.c | 7 | ||||
-rw-r--r-- | source3/libsmb/libsmb_context.c | 19 |
2 files changed, 24 insertions, 2 deletions
diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c index 9cc8110576..a15fa5f7d8 100644 --- a/source3/libsmb/clirap2.c +++ b/source3/libsmb/clirap2.c @@ -1856,6 +1856,7 @@ bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char +WORDSIZE]; /* buffer size? */ char upperbuf[MAX(RAP_USERNAME_LEN,RAP_MACHNAME_LEN)]; int res = -1; + char *tmp = NULL; memset(param, 0, sizeof(param)); @@ -1866,11 +1867,13 @@ bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char PUTDWORD(p, 0); /* Null pointer */ strlcpy(upperbuf, user, sizeof(upperbuf)); strupper_m(upperbuf); - PUTSTRINGF(p, upperbuf, RAP_USERNAME_LEN); + tmp = upperbuf; + PUTSTRINGF(p, tmp, RAP_USERNAME_LEN); p++; /* strange format, but ok */ strlcpy(upperbuf, workstation, sizeof(upperbuf)); strupper_m(upperbuf); - PUTSTRINGF(p, upperbuf, RAP_MACHNAME_LEN); + tmp = upperbuf; + PUTSTRINGF(p, tmp, RAP_MACHNAME_LEN); PUTWORD(p, CLI_BUFFER_SIZE); PUTWORD(p, CLI_BUFFER_SIZE); diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index b9b74fe7d2..be26a92ca9 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; |