aboutsummaryrefslogtreecommitdiff
path: root/libbb/procps.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-09-28 22:13:55 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-09-28 22:13:55 +0000
commitab8c9378c93168fcf3f3d7b87089cdc7884880cd (patch)
treedd3c34a308411abf738a15064452d6cd0ebad3ee /libbb/procps.c
parent6081868ee33c44f5a7227b77876d7e7a83c8aa9e (diff)
downloadbusybox-w32-ab8c9378c93168fcf3f3d7b87089cdc7884880cd.tar.gz
busybox-w32-ab8c9378c93168fcf3f3d7b87089cdc7884880cd.tar.bz2
busybox-w32-ab8c9378c93168fcf3f3d7b87089cdc7884880cd.zip
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 3a31eeff3..f1c0b6d27 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -353,14 +353,10 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
353 353
354#if 0 /* PSSCAN_CMD is not used */ 354#if 0 /* PSSCAN_CMD is not used */
355 if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) { 355 if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
356 if (sp->argv0) { 356 free(sp->argv0);
357 free(sp->argv0); 357 sp->argv0 = NULL;
358 sp->argv0 = NULL; 358 free(sp->cmd);
359 } 359 sp->cmd = NULL;
360 if (sp->cmd) {
361 free(sp->cmd);
362 sp->cmd = NULL;
363 }
364 strcpy(filename_tail, "/cmdline"); 360 strcpy(filename_tail, "/cmdline");
365 /* TODO: to get rid of size limits, read into malloc buf, 361 /* TODO: to get rid of size limits, read into malloc buf,
366 * then realloc it down to real size. */ 362 * then realloc it down to real size. */
@@ -380,10 +376,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
380 } 376 }
381#else 377#else
382 if (flags & PSSCAN_ARGV0) { 378 if (flags & PSSCAN_ARGV0) {
383 if (sp->argv0) { 379 free(sp->argv0);
384 free(sp->argv0); 380 sp->argv0 = NULL;
385 sp->argv0 = NULL;
386 }
387 strcpy(filename_tail, "/cmdline"); 381 strcpy(filename_tail, "/cmdline");
388 n = read_to_buf(filename, buf); 382 n = read_to_buf(filename, buf);
389 if (n <= 0) 383 if (n <= 0)