Avoid memory leaks from file selection
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17106
This commit is contained in:
parent
6ef0ac6e67
commit
62049ea18c
@ -836,6 +836,9 @@ select_file_by_path(sc_card_t * card, unsigned short *pathptr,
|
||||
priv->curpathlen--;
|
||||
priv->is_ef = 0;
|
||||
}
|
||||
/* Free the previously allocated file so we do not leak memory here */
|
||||
sc_file_free(*file);
|
||||
*file = NULL;
|
||||
r = select_down(card, pathptr, pathlen, 0, file);
|
||||
}
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user