Skip to content

Commit

Permalink
generate-pkcs7.c: Responded to memory leak from memory tests
Browse files Browse the repository at this point in the history
Forgot to free an array. Issue uncovered by memory checks during test case
  • Loading branch information
nick-child-ibm committed Jan 26, 2021
1 parent a25fe22 commit 62586e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extraMbedtls/generate-pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ int to_pkcs7_generate_signature(unsigned char **pkcs7, size_t *pkcs7Size, const
if (keys[i]) free(keys[i]);
}
if (keys) free (keys);
if (keySizes) free(keySizes);

return rc;
}
Expand Down Expand Up @@ -816,7 +817,7 @@ int to_pkcs7_already_signed_data(unsigned char **pkcs7, size_t *pkcs7Size, const
if (sigs[i]) free(sigs[i]);
}
if (sigs) free (sigs);

if (sig_sizes) free(sig_sizes);
return rc;
}
#endif

0 comments on commit 62586e3

Please sign in to comment.