mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
avoid use after free in error case
This commit is contained in:
3
src/pk.c
3
src/pk.c
@@ -360,8 +360,7 @@ static int der_to_enc_pem_alloc(unsigned char* der, int derSz,
|
||||
DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (tmpBuf == NULL) {
|
||||
WOLFSSL_ERROR_MSG("Extending DER buffer failed");
|
||||
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
ret = 0;
|
||||
ret = 0; /* der buffer is free'd at the end of the function */
|
||||
}
|
||||
else {
|
||||
der = tmpBuf;
|
||||
|
Reference in New Issue
Block a user