From faa1a1910f032c6c3bbc7b8da36332c3f8f434d0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 8 Sep 2020 23:16:07 +0200 Subject: 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 --- lib/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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); } -- cgit v1.2.3