summaryrefslogtreecommitdiff
path: root/libbb/procps.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-09-28 22:13:55 +0000
committerDenis Vlasenko2007-09-28 22:13:55 +0000
commitab8c9378c93168fcf3f3d7b87089cdc7884880cd (patch)
treedd3c34a308411abf738a15064452d6cd0ebad3ee /libbb/procps.c
parent6081868ee33c44f5a7227b77876d7e7a83c8aa9e (diff)
downloadbusybox-ab8c9378c93168fcf3f3d7b87089cdc7884880cd.zip
busybox-ab8c9378c93168fcf3f3d7b87089cdc7884880cd.tar.gz
more "if (p) free(p)" fixes; fix a typo in comment
Diffstat (limited to 'libbb/procps.c')
-rw-r--r--libbb/procps.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index 3a31eef..f1c0b6d 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -353,14 +353,10 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
#if 0 /* PSSCAN_CMD is not used */
if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
- if (sp->argv0) {
- free(sp->argv0);
- sp->argv0 = NULL;
- }
- if (sp->cmd) {
- free(sp->cmd);
- sp->cmd = NULL;
- }
+ free(sp->argv0);
+ sp->argv0 = NULL;
+ free(sp->cmd);
+ sp->cmd = NULL;
strcpy(filename_tail, "/cmdline");
/* TODO: to get rid of size limits, read into malloc buf,
* then realloc it down to real size. */
@@ -380,10 +376,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
}
#else
if (flags & PSSCAN_ARGV0) {
- if (sp->argv0) {
- free(sp->argv0);
- sp->argv0 = NULL;
- }
+ free(sp->argv0);
+ sp->argv0 = NULL;
strcpy(filename_tail, "/cmdline");
n = read_to_buf(filename, buf);
if (n <= 0)