Skip to content

Commit

Permalink
Passkey: Fix coverity RESOURCE_LEAK
Browse files Browse the repository at this point in the history
Fix for:

  CID 470374:  Resource leaks  (RESOURCE_LEAK)
  Variable "prompt_reply" going out of scope leaks the storage
  it points to.
  • Loading branch information
justin-stephenson committed Dec 11, 2023
1 parent e080776 commit a096f68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/krb5_plugin/passkey/passkey_clpreauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ sss_passkeycl_process(krb5_context context,
const char *state;
char prompt_answer[255] = {0};
int answer_len;
const char *prompt_reply = NULL;
char *prompt_reply = NULL;
uint8_t *reply = NULL;
const char *answer;

Expand Down Expand Up @@ -365,6 +365,9 @@ sss_passkeycl_process(krb5_context context,
if (reply != NULL) {
free(reply);
}
if (prompt_reply != NULL) {
free(prompt_reply);
}
return ret;
}

Expand Down

0 comments on commit a096f68

Please sign in to comment.