mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
Fix potential NULL ptr dereference, found by Coverity
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
9304024841
commit
83aa6abb1c
1 file changed
+3
@@ -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