Fix function logic

This commit is contained in:
Andras Fekete
2024-05-10 15:01:41 -04:00
parent 8f9c8a1203
commit f73a9f0d4f

View File

@ -15745,7 +15745,7 @@ int wolfSSL_PEM_read_bio(WOLFSSL_BIO* bio, char **name, char **header,
* @param [in] header Encryption header. * @param [in] header Encryption header.
* @param [in] data DER data. * @param [in] data DER data.
* @param [in] len Length of DER data. * @param [in] len Length of DER data.
* @return 0 on success. * @return 0 on failure.
* @return MEMORY_E when dynamic memory allocation fails. * @return MEMORY_E when dynamic memory allocation fails.
*/ */
int wolfSSL_PEM_write_bio(WOLFSSL_BIO* bio, const char *name, int wolfSSL_PEM_write_bio(WOLFSSL_BIO* bio, const char *name,
@ -15770,6 +15770,7 @@ int wolfSSL_PEM_write_bio(WOLFSSL_BIO* bio, const char *name,
/* Write PEM into BIO. */ /* Write PEM into BIO. */
if ((!err) && (wolfSSL_BIO_write(bio, pem, pemLen) != (int)pemLen)) { if ((!err) && (wolfSSL_BIO_write(bio, pem, pemLen) != (int)pemLen)) {
pemLen = 0; pemLen = 0;
err = 1;
} }
XFREE(pem, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(pem, NULL, DYNAMIC_TYPE_TMP_BUFFER);