Skip to content

Commit ab6c6ee

Browse files
Fix memory leak in ParseCRL_Extensions
1 parent 6f78c26 commit ab6c6ee

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

wolfcrypt/src/asn.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40593,9 +40593,13 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf, word32 idx,
4059340593
ret = GetInt(m, buf, &localIdx, maxIdx);
4059440594
}
4059540595

40596-
if (ret == 0 && mp_toradix(m, (char*)dcrl->crlNumber,
40597-
MP_RADIX_HEX) != MP_OKAY)
40598-
ret = BUFFER_E;
40596+
if (ret == 0) {
40597+
if (mp_toradix(m, (char*)dcrl->crlNumber,
40598+
MP_RADIX_HEX) != MP_OKAY) {
40599+
ret = BUFFER_E;
40600+
}
40601+
mp_free(m);
40602+
}
4059940603

4060040604
if (ret == 0) {
4060140605
dcrl->crlNumberSet = 1;

0 commit comments

Comments
 (0)