fixed memory leak

This commit is contained in:
Frank Morgner 2015-10-14 22:34:44 +02:00
parent 15f204c5d6
commit a5685b537e
1 changed files with 3 additions and 2 deletions

View File

@ -41,12 +41,13 @@ static
int dump_ef(sc_card_t * card, const char *path, u8 * buf, size_t * buf_len)
{
int rv;
sc_file_t *file = sc_file_new();
sc_file_t *file = NULL;
sc_path_t scpath;
sc_format_path(path, &scpath);
rv = sc_select_file(card, &scpath, &file);
if (rv < 0) {
sc_file_free(file);
if (file)
sc_file_free(file);
return rv;
}
if (file->size > *buf_len) {