/** * Free structure allocated in decodePrivateKeyDescription() * * @param p15 Pointer to pointer to structure. Pointer is cleared with NULL */ void freePrivateKeyDescription(struct p15PrivateKeyDescription **p15) { if (*p15 != NULL) { freeCommonObjectAttributes(&(*p15)->coa); if ((*p15)->id) { free((*p15)->id); (*p15)->id = NULL; } free(*p15); } *p15 = NULL; }
/** * Free structure allocated in decodeCertificateDescription() * * @param p15 Pointer to pointer to structure. Pointer is cleared with NULL */ void freeCertificatePrivateKeyDescription(struct p15CertificateDescription **p15) { if (*p15 != NULL) { freeCommonObjectAttributes(&(*p15)->coa); if ((*p15)->id.val) { free((*p15)->id.val); (*p15)->id.val = NULL; (*p15)->id.len = 0; } free(*p15); } *p15 = NULL; }