OpenPGP: immediately quit on allocation errors in init

Signed-off-by: Peter Marschall <peter@adpm.de>
This commit is contained in:
Peter Marschall 2011-06-01 13:41:25 +02:00
parent e3fca4ac11
commit b6ee0e3d75
1 changed files with 4 additions and 9 deletions

View File

@ -324,18 +324,13 @@ pgp_init(sc_card_t *card)
(info->get_fn != NULL)) {
child = pgp_new_blob(priv->mf, info->id, info->type, info);
/* catch out of memory condition */
if (child == NULL)
break;
if (child == NULL) {
pgp_finish(card);
return SC_ERROR_OUT_OF_MEMORY;
}
}
}
/* treat out of memory condition */
if (child == NULL) {
pgp_finish(card);
return SC_ERROR_OUT_OF_MEMORY;
}
/* get card_features from ATR & DOs */
pgp_get_card_features(card);