lib/procutils: check fgets() return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
cba69bb551
commit
8471bc61f9
|
@ -174,6 +174,8 @@ int proc_next_pid(struct proc_processes *ps, pid_t *pid)
|
|||
|
||||
p = fgets(buf, sizeof(buf), f);
|
||||
fclose(f);
|
||||
if (!p)
|
||||
continue;
|
||||
|
||||
if (sscanf(buf, "%*d (%255[^)])", procname) != 1)
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue