aboutsummaryrefslogtreecommitdiff
path: root/libps
diff options
context:
space:
mode:
Diffstat (limited to 'libps')
-rw-r--r--libps/fmt.c9
-rw-r--r--libps/proclist.c6
2 files changed, 5 insertions, 10 deletions
diff --git a/libps/fmt.c b/libps/fmt.c
index cd838852..46416632 100644
--- a/libps/fmt.c
+++ b/libps/fmt.c
@@ -362,12 +362,9 @@ ps_fmt_clone (struct ps_fmt *fmt, struct ps_fmt **copy)
if (!new || !fields || !src)
{
- if (new)
- free (new);
- if (fields)
- free (fields);
- if (src)
- free (src);
+ free (new);
+ free (fields);
+ free (src);
return ENOMEM;
}
diff --git a/libps/proclist.c b/libps/proclist.c
index 50aed73a..2201cadc 100644
--- a/libps/proclist.c
+++ b/libps/proclist.c
@@ -63,10 +63,8 @@ proc_stat_list_clone (struct proc_stat_list *pp, struct proc_stat_list **copy)
if (!new || !procs)
{
- if (new)
- free (new);
- if (procs)
- free (procs);
+ free (new);
+ free (procs);
return ENOMEM;
}