diff options
Diffstat (limited to 'libcli/smb')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 4 | ||||
-rw-r--r-- | libcli/smb/smb_seal.c | 19 | ||||
-rw-r--r-- | libcli/smb/smb_seal.h | 1 |
3 files changed, 2 insertions, 22 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 06fcb34a31..df0145718e 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -214,7 +214,7 @@ static int smbXcli_conn_destructor(struct smbXcli_conn *conn) } if (conn->smb1.trans_enc) { - common_free_encryption_state(&conn->smb1.trans_enc); + TALLOC_FREE(conn->smb1.trans_enc); } return 0; @@ -596,7 +596,7 @@ void smb1cli_conn_set_encryption(struct smbXcli_conn *conn, { /* Replace the old state, if any. */ if (conn->smb1.trans_enc) { - common_free_encryption_state(&conn->smb1.trans_enc); + TALLOC_FREE(conn->smb1.trans_enc); } conn->smb1.trans_enc = es; } diff --git a/libcli/smb/smb_seal.c b/libcli/smb/smb_seal.c index a56dc6092e..d5bb2388bb 100644 --- a/libcli/smb/smb_seal.c +++ b/libcli/smb/smb_seal.c @@ -200,25 +200,6 @@ NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf) } /****************************************************************************** - Shutdown an encryption state. -******************************************************************************/ - -void common_free_encryption_state(struct smb_trans_enc_state **pp_es) -{ - struct smb_trans_enc_state *es = *pp_es; - - if (es == NULL) { - return; - } - - if (es->gensec_security) { - TALLOC_FREE(es->gensec_security); - } - SAFE_FREE(es); - *pp_es = NULL; -} - -/****************************************************************************** Free an encryption-allocated buffer. ******************************************************************************/ diff --git a/libcli/smb/smb_seal.h b/libcli/smb/smb_seal.h index 01a61e8586..f47f904528 100644 --- a/libcli/smb/smb_seal.h +++ b/libcli/smb/smb_seal.h @@ -32,7 +32,6 @@ NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16_t *p_enc_ctx_num); bool common_encryption_on(struct smb_trans_enc_state *es); NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out); NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf); -void common_free_encryption_state(struct smb_trans_enc_state **pp_es); void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf); #endif /* _HEADER_SMB_CRYPT_H */ |