- do not access file afterdeleting it (S Bakkal)

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1682 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-12-18 08:00:27 +00:00
parent c2083ba406
commit af37c4e026
1 changed files with 1 additions and 1 deletions

View File

@ -2729,7 +2729,7 @@ sc_pkcs15init_read_info(sc_card_t *card, sc_profile_t *profile)
len = file->size;
sc_file_free(file);
r = SC_ERROR_OUT_OF_MEMORY;
if ((mem = (u8 *) malloc(file->size)) != NULL) {
if ((mem = (u8 *) malloc(len)) != NULL) {
r = sc_read_binary(card, 0, mem, len, 0);
}
} else {