Add debugging info to new ASN1 code to trace memory leaks.

Fix PKCS7 and PKCS12 memory leaks.

Initialise encapsulated content type properly.
This commit is contained in:
Dr. Stephen Henson
2001-01-24 18:39:54 +00:00
parent 9ae9c221de
commit a43cf9fae9
6 changed files with 58 additions and 15 deletions

View File

@@ -69,15 +69,7 @@ PKCS12 *PKCS12_init (int mode)
PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
return NULL;
}
if (!(pkcs12->version = M_ASN1_INTEGER_new ())) {
PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
return NULL;
}
ASN1_INTEGER_set(pkcs12->version, 3);
if (!(pkcs12->authsafes = PKCS7_new())) {
PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE);
return NULL;
}
pkcs12->authsafes->type = OBJ_nid2obj(mode);
switch (mode) {
case NID_pkcs7_data: