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
commitac75e3648e6a9c3a8cf45d5fa491abd3a3ab3613 (patch)
tree42afd9455d4384b82a70625ec8b7194d4a08efda /proclist.c
parent3907bbbcfb806799a5349e46a2b804307a0e9836 (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 4dd6ab3..16cef9d 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);
}