diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index c6f24c5e80..8d9fcb61d6 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -203,6 +203,12 @@ struct cli_state *cli_initialise(struct cli_state *cli) return False; } + if ((cli->mem_ctx = talloc_init()) == NULL) { + free(cli->outbuf); + free(cli->inbuf); + return False; + } + memset(cli->outbuf, '\0', cli->bufsize); memset(cli->inbuf, '\0', cli->bufsize); @@ -224,6 +230,10 @@ void cli_shutdown(struct cli_state *cli) { free(cli->inbuf); } + + if (cli->mem_ctx) + talloc_destroy(cli->mem_ctx); + #ifdef WITH_SSL if (cli->fd != -1) sslutil_disconnect(cli->fd); |