Check the return values where memory allocation failures may happen.

PR: 49
This commit is contained in:
Richard Levitte
2002-05-30 16:49:00 +00:00
parent 04c8e99b39
commit d66c022a1f
16 changed files with 77 additions and 47 deletions

View File

@@ -228,7 +228,7 @@ int OBJ_add_object(ASN1_OBJECT *obj)
if (added == NULL)
if (!init_added()) return(0);
if ((o=OBJ_dup(obj)) == NULL) goto err;
ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
if (!(ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err;
if ((o->length != 0) && (obj->data != NULL))
ao[ADDED_DATA]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
if (o->sn != NULL)