Fix CID 1134837

This commit is contained in:
Anton Kochkov 2014-05-03 04:02:36 +04:00
parent ea57383d84
commit d56b4046de

View File

@ -520,8 +520,10 @@ static int apprentice_load(RMagic *ms, struct r_magic **magicp, ut32 *nmagicp, c
/* load directory or file */ /* load directory or file */
if (stat (fn, &st) == 0 && S_ISDIR (st.st_mode)) { if (stat (fn, &st) == 0 && S_ISDIR (st.st_mode)) {
if (r_sandbox_enable (0) && !r_sandbox_check_path (fn)) if (r_sandbox_enable (0) && !r_sandbox_check_path (fn)) {
free (marray);
return -1; return -1;
}
dir = opendir (fn); dir = opendir (fn);
if (dir) { if (dir) {
while ((d = readdir (dir))) { while ((d = readdir (dir))) {