CertSvcStoreCertList *createStoreListNode(VcoreCertResponseData *cert)
{
- CertSvcStoreCertList *node = NULL;
-
- if (cert == NULL || cert->gname == NULL || cert->title == NULL)
+ if (cert == NULL)
return NULL;
- node = (CertSvcStoreCertList *)malloc(sizeof(CertSvcStoreCertList));
+ CertSvcStoreCertList *node = (CertSvcStoreCertList *)malloc(sizeof(CertSvcStoreCertList));
if (node == NULL)
return NULL;
if (fwrite(certBuffer, sizeof(char), length, fp_write) != length) {
LogError("Fail to write certificate.");
result = CERTSVC_FAIL;
- fclose(fp_write);
goto error;
}
if (result != CERTSVC_SUCCESS) {
LogError("Failed to construct certificate from buffer.");
- fclose(fp_write);
goto error;
}
- fclose(fp_write);
unlink(fileName.c_str());
}
result = CERTSVC_SUCCESS;
} catch (std::bad_alloc &) {
- return CERTSVC_BAD_ALLOC;
+ result = CERTSVC_BAD_ALLOC;
} catch (...) {}
error:
+ if (x509Struct)
+ X509_free(x509Struct);
- if (x509Struct) X509_free(x509Struct);
+ if (pBio)
+ BIO_free(pBio);
- if (pBio) BIO_free(pBio);
+ if (fp_write)
+ fclose(fp_write);
return result;
}