Skip to content

Commit a31d8c5

Browse files
author
Andras Fekete
committed
Addressing PR comments
1 parent b6a9c38 commit a31d8c5

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/ssl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13566,7 +13566,9 @@ WOLFSSL_STACK* wolfSSL_sk_new_node(void* heap)
1356613566
/* free's node but does not free internal data such as in->data.x509 */
1356713567
void wolfSSL_sk_free_node(WOLFSSL_STACK* in)
1356813568
{
13569-
XFREE(in, in->heap, DYNAMIC_TYPE_OPENSSL);
13569+
if (in != NULL) {
13570+
XFREE(in, in->heap, DYNAMIC_TYPE_OPENSSL);
13571+
}
1357013572
}
1357113573

1357213574
/* pushes node "in" onto "stack" and returns pointer to the new stack on success

src/x509.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9684,7 +9684,9 @@ WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_X509_chain_up_ref(
96849684
{
96859685
WOLFSSL_ENTER("wolfSSL_X509_NAME_free");
96869686
FreeX509Name(name);
9687-
XFREE(name, name->heap, DYNAMIC_TYPE_X509);
9687+
if (name != NULL) {
9688+
XFREE(name, name->heap, DYNAMIC_TYPE_X509);
9689+
}
96889690
}
96899691

96909692

wolfcrypt/src/evp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12282,7 +12282,9 @@ struct WOLFSSL_EVP_ENCODE_CTX* wolfSSL_EVP_ENCODE_CTX_new(void)
1228212282
void wolfSSL_EVP_ENCODE_CTX_free(WOLFSSL_EVP_ENCODE_CTX* ctx)
1228312283
{
1228412284
WOLFSSL_ENTER("wolfSSL_EVP_ENCODE_CTX_free");
12285-
XFREE(ctx, ctx->heap, DYNAMIC_TYPE_OPENSSL);
12285+
if (ctx != NULL) {
12286+
XFREE(ctx, ctx->heap, DYNAMIC_TYPE_OPENSSL);
12287+
}
1228612288
}
1228712289
#endif /* WOLFSSL_BASE64_ENCODE || WOLFSSL_BASE64_DECODE */
1228812290
#if defined(WOLFSSL_BASE64_ENCODE)

0 commit comments

Comments
 (0)