help out static analysis tool

This commit is contained in:
Jacob Barthelmeh
2019-08-22 11:49:10 -06:00
parent 01a3b59e28
commit b83aebafb1

View File

@ -784,9 +784,6 @@ int wc_i2d_PKCS12(WC_PKCS12* pkcs12, byte** der, int* derSz)
if (*der == NULL) {
/* Allocate if requested */
buf = (byte*)XMALLOC(totalSz, NULL, DYNAMIC_TYPE_PKCS);
if (buf == NULL) {
ret = MEMORY_E;
}
}
else {
buf = *der;
@ -802,6 +799,10 @@ int wc_i2d_PKCS12(WC_PKCS12* pkcs12, byte** der, int* derSz)
}
}
if (buf == NULL) {
ret = MEMORY_E;
}
if (ret == 0) {
idx = 0;