summaryrefslogtreecommitdiff
path: root/proclist.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-17 16:48:55 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:14:48 +0200
commitef3adf6d159d566d83335cfe55a72206d492d838 (patch)
tree0eb552f0074b20c8f96dcecd9069431546f6e0f0 /proclist.c
parent1db5f258c1ce92d92aa1589762865d96cbb20971 (diff)
Fix the failure semantics of procfs_make_node
* procfs.c (procfs_make_node): Invoke the cleanup callback on failure, so that callers don't have to. * procfs.h: Document the change. * procfs_dir.c (procfs_dir_make_node), procfs_file.c (procfs_file_make_node), proclist.c (proclist_make_node): Update to reflect the change.
Diffstat (limited to 'proclist.c')
-rw-r--r--proclist.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/proclist.c b/proclist.c
index 4dd6ab31..16cef9d6 100644
--- a/proclist.c
+++ b/proclist.c
@@ -63,7 +63,6 @@ proclist_make_node (process_t process)
.cleanup = free,
};
struct proclist_node *pl;
- struct node *np;
pl = malloc (sizeof *pl);
if (! pl)
@@ -72,10 +71,6 @@ proclist_make_node (process_t process)
memset (pl, 0, sizeof *pl);
pl->process = process;
- np = procfs_make_node (&ops, pl);
- if (! np)
- free (pl);
-
- return np;
+ return procfs_make_node (&ops, pl);
}