CID 426426 code maintainability warning, stored NULL value overwritten before used

This commit is contained in:
JacobBarthelmeh
2024-10-23 18:05:12 -06:00
parent 077b070132
commit 52ba700eb3

View File

@ -1766,10 +1766,9 @@ WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* wolfSSL_X509_STORE_get0_objects(
} }
obj->type = WOLFSSL_X509_LU_X509; obj->type = WOLFSSL_X509_LU_X509;
obj->data.x509 = x509; obj->data.x509 = x509;
x509 = NULL;
} }
while(wolfSSL_sk_X509_num(cert_stack) > 0) { while (wolfSSL_sk_X509_num(cert_stack) > 0) {
wolfSSL_sk_X509_pop(cert_stack); wolfSSL_sk_X509_pop(cert_stack);
} }
#endif #endif
@ -1799,7 +1798,7 @@ err_cleanup:
if (ret != NULL) if (ret != NULL)
X509StoreFreeObjList(store, ret); X509StoreFreeObjList(store, ret);
if (cert_stack != NULL) { if (cert_stack != NULL) {
while(store->numAdded > 0) { while (store->numAdded > 0) {
wolfSSL_sk_X509_pop(cert_stack); wolfSSL_sk_X509_pop(cert_stack);
store->numAdded--; store->numAdded--;
} }