fix resource leak for not invoking closedir() after opendir()

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
This commit is contained in:
Yunfeng Ye 2019-10-11 17:30:08 +08:00
parent 0e741b2624
commit d23f36745e
2 changed files with 2 additions and 0 deletions

View file

@ -583,6 +583,7 @@ static void get_irq_user_policy(char *path, int irq, struct user_irq_policy *pol
break;
}
}
closedir(poldir);
}
}
}

View file

@ -424,6 +424,7 @@ int main(int argc, char **argv)
fclose(f);
}
} while((entry) && (irqbalance_pid == -1));
closedir(dir);
}
if(irqbalance_pid == -1) {
printf("Unable to determine irqbalance PID\n");