free buffer on error case

This commit is contained in:
JacobBarthelmeh
2023-10-16 15:04:57 -06:00
parent ae3fdbec47
commit b7b0316ac9

View File

@@ -628,6 +628,7 @@ static int ConvDerToPem(unsigned char* in, word32 offset, word32 len,
type); type);
if (ret <= 0) { if (ret <= 0) {
fprintf(stderr, "Could not convert DER to PEM\n"); fprintf(stderr, "Could not convert DER to PEM\n");
free(pem);
} }
if (ret > 0) { if (ret > 0) {
*out = pem; *out = pem;