Skip to content

Commit

Permalink
popen should pclose
Browse files Browse the repository at this point in the history
```
In function ‘find_readline_so’,
    inlined from ‘main’ at bashreadline.c:163:33:
bashreadline.c:135:17: warning: ‘fclose’ called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  135 |                 fclose(fp);
      |                 ^~~~~~~~~~
bashreadline.c: In function ‘main’:
bashreadline.c:119:14: note: returned from ‘popen’
  119 |         fp = popen("ldd /bin/bash", "r");
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  • Loading branch information
Rtoax authored and yonghong-song committed Jan 31, 2022
1 parent 7db3488 commit bc89fce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbpf-tools/bashreadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static char *find_readline_so()
if (line)
free(line);
if (fp)
fclose(fp);
pclose(fp);
return result;
}

Expand Down

0 comments on commit bc89fce

Please sign in to comment.