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; }