mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 00:24:17 +07:00
Fix potential NULL ptr dereference, found by Coverity
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -122,6 +122,9 @@ static int sulogin(int do_reboot)
|
||||
for (i = 0; i < NELEMS(cmd); i++) {
|
||||
char *path = which(cmd[i]);
|
||||
|
||||
if (!path)
|
||||
continue;
|
||||
|
||||
if (access(path, X_OK)) {
|
||||
free(path);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user