projects
/
external
/
corewatcher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3df2dda
)
Fixup pointers that aren't initialized to NULL
author
William Douglas
<william.douglas@linux.intel.com>
Fri, 4 Mar 2011 22:23:12 +0000
(14:23 -0800)
committer
William Douglas
<william.douglas@linux.intel.com>
Fri, 4 Mar 2011 22:23:12 +0000
(14:23 -0800)
coredump.c
patch
|
blob
|
history
diff --git
a/coredump.c
b/coredump.c
index
046eb3a
..
d59175e
100644
(file)
--- a/
coredump.c
+++ b/
coredump.c
@@
-279,13
+279,14
@@
void wrapper_scan(char *command)
break;
}
}
- free(line);
+ if (line)
+ free(line);
pclose(file);
}
char *extract_core(char *corefile)
{
- char *command = NULL, *c1 = NULL, *c2 = NULL, *line;
+ char *command = NULL, *c1 = NULL, *c2 = NULL, *line
= NULL
;
char *coredump = NULL;
char *appfile;
FILE *file;
@@
-337,7
+338,8
@@
char *extract_core(char *corefile)
asprintf(&c1, "%s", line);
}
}
- free(line);
+ if (line)
+ free(line);
pclose(file);
free(command);
return c1;