diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-17 16:48:55 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:14:48 +0200 |
commit | ef3adf6d159d566d83335cfe55a72206d492d838 (patch) | |
tree | 0eb552f0074b20c8f96dcecd9069431546f6e0f0 /proclist.c | |
parent | 1db5f258c1ce92d92aa1589762865d96cbb20971 (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.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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); } |