mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +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++) {
|
for (i = 0; i < NELEMS(cmd); i++) {
|
||||||
char *path = which(cmd[i]);
|
char *path = which(cmd[i]);
|
||||||
|
|
||||||
|
if (!path)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (access(path, X_OK)) {
|
if (access(path, X_OK)) {
|
||||||
free(path);
|
free(path);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in new issue
Block a user