From 59b4656a98a528dd108f3e3aace6cf83abec8d26 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 6 Oct 2024 14:03:30 +1000 Subject: [PATCH] connect: fix memoryleak if the session is lost during connect Signed-off-by: Ronnie Sahlberg --- lib/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sync.c b/lib/sync.c index 6ca00041..85083fa8 100644 --- a/lib/sync.c +++ b/lib/sync.c @@ -134,7 +134,6 @@ int smb2_connect_share(struct smb2_context *smb2, } rc = smb2_connect_share_async(smb2, server, share, user, connect_cb, cb_data); - if (rc < 0) { goto out; } @@ -142,6 +141,7 @@ int smb2_connect_share(struct smb2_context *smb2, rc = wait_for_reply(smb2, cb_data); if (rc < 0) { cb_data->status = SMB2_STATUS_CANCELLED; + free(cb_data); return rc; }