OpenPGP: free memory when selecting the application fails
free() the memory already reserved when the file identifying the OpenPGP application fails & reset the pointers in the card strcuture back to NULL. Signed-off-by: Peter Marschall <peter@adpm.de> git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5481 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
56f6718bf2
commit
6e04d7f6bf
|
@ -178,8 +178,12 @@ pgp_init(sc_card_t *card)
|
||||||
/* select application "OpenPGP" */
|
/* select application "OpenPGP" */
|
||||||
sc_format_path("D276:0001:2401", &aid);
|
sc_format_path("D276:0001:2401", &aid);
|
||||||
aid.type = SC_PATH_TYPE_DF_NAME;
|
aid.type = SC_PATH_TYPE_DF_NAME;
|
||||||
if ((r = iso_ops->select_file(card, &aid, &file)) < 0)
|
if ((r = iso_ops->select_file(card, &aid, &file)) < 0) {
|
||||||
|
free(priv->mf);
|
||||||
|
free(priv);
|
||||||
|
card->drv_data = NULL;
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
sc_format_path("3f00", &file->path);
|
sc_format_path("3f00", &file->path);
|
||||||
file->type = SC_FILE_TYPE_DF;
|
file->type = SC_FILE_TYPE_DF;
|
||||||
|
|
Loading…
Reference in New Issue