Skip to content

Commit 1da7280

Browse files
timp87ffainelli
authored andcommitted
Fix an infrequent crash
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> [Upstream: opsengine#61]
1 parent 19f1937 commit 1da7280

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/process_iterator_linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static int read_process_info(pid_t pid, struct process *p)
9898
//read command line
9999
sprintf(exefile,"/proc/%d/cmdline", p->pid);
100100
fd = fopen(exefile, "r");
101+
if (fd==NULL) return -1;
101102
if (fgets(buffer, sizeof(buffer), fd)==NULL) {
102103
fclose(fd);
103104
return -1;

0 commit comments

Comments
 (0)