diff options
author | Jeremy Allison <jra@samba.org> | 2006-12-15 00:49:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:29 -0500 |
commit | d29722e378011e6085e007e1e6c39a9f002eb2fe (patch) | |
tree | 33868139ba382717ad5ed5b5067723cc6bbaf18b /source3/smbd/conn.c | |
parent | 806daad51088bddcedda0274333b3f9e17cc26b3 (diff) | |
download | samba-d29722e378011e6085e007e1e6c39a9f002eb2fe.tar.gz samba-d29722e378011e6085e007e1e6c39a9f002eb2fe.tar.xz samba-d29722e378011e6085e007e1e6c39a9f002eb2fe.zip |
r20178: Ensure we allocate the intermediate trans structs
off conn->mem_ctx, not the null context so we can
safefy free everything on conn close. Should fix
possible memleak.
Jeremy.
(This used to be commit b33bde7b39953e171f05cdb53b6345ee3a9ec6e7)
Diffstat (limited to 'source3/smbd/conn.c')
-rw-r--r-- | source3/smbd/conn.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 19ed49e7bf4..083e8339c80 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -257,6 +257,7 @@ void conn_free_internal(connection_struct *conn) { vfs_handle_struct *handle = NULL, *thandle = NULL; TALLOC_CTX *mem_ctx = NULL; + struct trans_state *state = NULL; /* Free vfs_connection_struct */ handle = conn->vfs_handles; @@ -268,6 +269,13 @@ void conn_free_internal(connection_struct *conn) handle = thandle; } + /* Free any pending transactions stored on this conn. */ + for (state = conn->pending_trans; state; state = state->next) { + /* state->setup is a talloc child of state. */ + SAFE_FREE(state->param); + SAFE_FREE(state->data); + } + free_namearray(conn->veto_list); free_namearray(conn->hide_list); free_namearray(conn->veto_oplock_list); |