summaryrefslogtreecommitdiffhomepage
path: root/lib/fs.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-08 23:16:07 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-08 23:16:07 +0200
commitfaa1a1910f032c6c3bbc7b8da36332c3f8f434d0 (patch)
treefb21ea692dc248a423b377756f32729884700e25 /lib/fs.c
parenta0171d56898234980f0694d87f0ef5528243b8b0 (diff)
fs: fix crash when closing file handle twice
We need to clear the file handle pointer after closing the file to avoid invoking the dtor later. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib/fs.c')
-rw-r--r--lib/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fs.c b/lib/fs.c
index ddc3bff..252689a 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -58,7 +58,7 @@ ut_fs_close(struct ut_state *s, uint32_t off, struct json_object *args)
err_return(EBADF);
fclose(*fp);
- //*fp = NULL;
+ *fp = NULL;
return json_object_new_boolean(true);
}