From 2c2fc9a2fddd0927a66f1c142e65c8dab6f5c5d7 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 14 Feb 2020 14:02:59 -0800 Subject: [PATCH] Don't call `free` on paths which are about to call `_Exit`. (#161) This is a minor code-size optimization. --- libc-bottom-half/libpreopen/libpreopen.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libc-bottom-half/libpreopen/libpreopen.c b/libc-bottom-half/libpreopen/libpreopen.c index 25c1040..789fe8d 100644 --- a/libc-bottom-half/libpreopen/libpreopen.c +++ b/libc-bottom-half/libpreopen/libpreopen.c @@ -547,13 +547,11 @@ __wasilibc_populate_libpreopen(void) // TODO: Remove the cast on `path` once the witx is updated with char8 support. ret = __wasi_fd_prestat_dir_name(fd, (uint8_t *)path, prestat.u.dir.pr_name_len); if (ret != __WASI_ERRNO_SUCCESS) { - free(path); goto oserr; } path[prestat.u.dir.pr_name_len] = '\0'; if (internal_register_preopened_fd(fd, path) != 0) { - free(path); goto software; } -- 2.39.2