more "if (p) free(p)" fixes; fix a typo in comment
This commit is contained in:
parent
6081868ee3
commit
ab8c9378c9
@ -30,7 +30,7 @@ getopt32(char **argv, const char *applet_opts, ...)
|
|||||||
|
|
||||||
"r" will add 1 (bit 0)
|
"r" will add 1 (bit 0)
|
||||||
"n" will add 2 (bit 1)
|
"n" will add 2 (bit 1)
|
||||||
"u will add 4 (bit 2)
|
"u" will add 4 (bit 2)
|
||||||
"g" will add 8 (bit 3)
|
"g" will add 8 (bit 3)
|
||||||
|
|
||||||
and so on. You can also look at the return value as a bit
|
and so on. You can also look at the return value as a bit
|
||||||
|
@ -353,14 +353,10 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
|
|||||||
|
|
||||||
#if 0 /* PSSCAN_CMD is not used */
|
#if 0 /* PSSCAN_CMD is not used */
|
||||||
if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
|
if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
|
||||||
if (sp->argv0) {
|
free(sp->argv0);
|
||||||
free(sp->argv0);
|
sp->argv0 = NULL;
|
||||||
sp->argv0 = NULL;
|
free(sp->cmd);
|
||||||
}
|
sp->cmd = NULL;
|
||||||
if (sp->cmd) {
|
|
||||||
free(sp->cmd);
|
|
||||||
sp->cmd = NULL;
|
|
||||||
}
|
|
||||||
strcpy(filename_tail, "/cmdline");
|
strcpy(filename_tail, "/cmdline");
|
||||||
/* TODO: to get rid of size limits, read into malloc buf,
|
/* TODO: to get rid of size limits, read into malloc buf,
|
||||||
* then realloc it down to real size. */
|
* then realloc it down to real size. */
|
||||||
@ -380,10 +376,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (flags & PSSCAN_ARGV0) {
|
if (flags & PSSCAN_ARGV0) {
|
||||||
if (sp->argv0) {
|
free(sp->argv0);
|
||||||
free(sp->argv0);
|
sp->argv0 = NULL;
|
||||||
sp->argv0 = NULL;
|
|
||||||
}
|
|
||||||
strcpy(filename_tail, "/cmdline");
|
strcpy(filename_tail, "/cmdline");
|
||||||
n = read_to_buf(filename, buf);
|
n = read_to_buf(filename, buf);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user