Skip to content

Commit

Permalink
Fix connection timeout or failure memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghao committed Aug 10, 2023
1 parent 04011e4 commit 7c4dd91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ void smb2_destroy_context(struct smb2_context *smb2)
if (smb2->dirs) {
smb2_free_all_dirs(smb2);
}

if (smb2->connect_cb) {
smb2->connect_cb(smb2, SMB2_STATUS_CANCELLED,
NULL, smb2->connect_data);
smb2->connect_cb = NULL;
}
free(smb2->session_key);
smb2->session_key = NULL;

Expand Down

0 comments on commit 7c4dd91

Please sign in to comment.