projects
/
lttng-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
988ae33
)
Fix: possible file descriptor leak in error path
author
David Goulet
<dgoulet@efficios.com>
Mon, 22 Sep 2014 14:55:52 +0000
(10:55 -0400)
committer
David Goulet
<dgoulet@efficios.com>
Mon, 22 Sep 2014 14:55:52 +0000
(10:55 -0400)
Fixes Coverity issue
1225086
.
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/list.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/lttng/commands/list.c
b/src/bin/lttng/commands/list.c
index 96ccdb039e53ef2d9e84609c75f087f7243f2480..318896559ffeab50a9a19ab4892471a27c6c86c0 100644
(file)
--- a/
src/bin/lttng/commands/list.c
+++ b/
src/bin/lttng/commands/list.c
@@
-110,7
+110,7
@@
static void usage(FILE *ofp)
static char *get_cmdline_by_pid(pid_t pid)
{
int ret;
- FILE *fp;
+ FILE *fp
= NULL
;
char *cmdline = NULL;
char path[20]; /* Can't go bigger than /proc/65535/cmdline */
@@
-130,9
+130,11
@@
static char *get_cmdline_by_pid(pid_t pid)
if (ret < 0) {
perror("fread proc list");
}
- fclose(fp);
end:
+ if (fp) {
+ fclose(fp);
+ }
return cmdline;
}
This page took
0.026957 seconds
and
4
git commands to generate.