Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ssl_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ int wolfSSL_ASN1_item_i2d(const void* obj, byte** dest,
{
int ret = 1;
int len = 0;
byte* buf = NULL;

WOLFSSL_ENTER("wolfSSL_ASN1_item_i2d");

Expand All @@ -408,6 +407,7 @@ int wolfSSL_ASN1_item_i2d(const void* obj, byte** dest,
ret = 0;

if ((ret == 1) && (dest != NULL)) {
byte* buf = NULL;
if (*dest == NULL) {
buf = (byte*)XMALLOC((size_t)len, NULL, DYNAMIC_TYPE_ASN1);
if (buf == NULL)
Expand All @@ -428,11 +428,11 @@ int wolfSSL_ASN1_item_i2d(const void* obj, byte** dest,
else
*dest += len;
}
if (*dest == NULL)
XFREE(buf, NULL, DYNAMIC_TYPE_ASN1);
}

if (ret == 0) {
if (*dest == NULL)
XFREE(buf, NULL, DYNAMIC_TYPE_ASN1);
len = WOLFSSL_FATAL_ERROR;
Comment thread
julek-wolfssl marked this conversation as resolved.
Outdated
}
WOLFSSL_LEAVE("wolfSSL_ASN1_item_i2d", len);
Expand Down
Loading