Skip to content

Commit

Permalink
ensure we have a username when connecting a share
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnie Sahlberg <[email protected]>
  • Loading branch information
sahlberg committed Dec 19, 2024
1 parent 8954af9 commit 80347b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/libsmb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,10 @@ smb2_connect_share_async(struct smb2_context *smb2,
smb2_set_error(smb2, "Failed to strdup(share)");
return -ENOMEM;
}
if (smb2->user == NULL) {
smb2_set_error(smb2, "smb2->user is NULL");
return -ENOMEM;
}
c_data->user = strdup(smb2->user);
if (c_data->user == NULL) {
free_c_data(smb2, c_data);
Expand Down

0 comments on commit 80347b3

Please sign in to comment.