From 639ec6dd97a3d27fd249fa0509f0f8ebfd1f4c91 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 4 Mar 2015 12:30:29 +0100 Subject: Fix stupid forget-to-unreference bug. --- src/kernel/user/process.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c index 4514218..0a757b4 100644 --- a/src/kernel/user/process.c +++ b/src/kernel/user/process.c @@ -290,7 +290,11 @@ fs_t *proc_find_fs(process_t *p, const char* name) { } void proc_remove_fs(process_t *p, const char* name) { - hashtbl_remove(p->filesystems, name); + fs_t *fs = proc_find_fs(p, name); + if (fs) { + unref_fs(fs); + hashtbl_remove(p->filesystems, name); + } } int proc_add_fd(process_t *p, fs_handle_t *f) { -- cgit v1.2.3