summaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-06-16 16:50:12 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-06-18 15:56:59 +0200
commit470972f3f854e92ee1cc8f1e2ada8412a2b97956 (patch)
tree8c0f07ecd01ce9a43c7988bd1d637ccf3b9d8850 /trans
parent7c5f22e6c746e97871c0339c0068825018754822 (diff)
trans/fakeroot: fix error handling
Found using the Clang Static Analyzer. * trans/fakeroot.c (new_node): Do not leak a pointer to freed memory. Store NULL at *np instead. This fixes a node use-after-free in netfs_S_dir_lookup.
Diffstat (limited to 'trans')
-rw-r--r--trans/fakeroot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 32a34ec4..df2de646 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -119,6 +119,7 @@ new_node (file_t file, mach_port_t idport, int locked, int openmodes,
mach_port_deallocate (mach_task_self (), nn->idport);
mach_port_deallocate (mach_task_self (), file);
free (*np);
+ *np = NULL;
return err;
}