Make sure only free'd on error

This commit is contained in:
Juliusz Sosinowicz
2026-03-06 18:01:02 +01:00
parent da9dc821e4
commit 3c06c22314
+1 -1
View File
@@ -428,7 +428,7 @@ int wolfSSL_ASN1_item_i2d(const void* obj, byte** dest,
else
*dest += len;
}
if (*dest == NULL)
if (ret == 0 && *dest == NULL)
XFREE(buf, NULL, DYNAMIC_TYPE_ASN1);
}