From f0896a0b75a9549729953c49f01955dbed931a75 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sun, 31 Mar 2024 17:13:32 +0300 Subject: [PATCH] Fix memory leak in linux_openat function --- syscalls/linux.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syscalls/linux.cpp b/syscalls/linux.cpp index 89f8ae9..de73874 100644 --- a/syscalls/linux.cpp +++ b/syscalls/linux.cpp @@ -2478,7 +2478,9 @@ static int linux_openat(SysFrm *, int dirfd, const char *pathname, int flags, mo const char *absPath = new char[strlen(absoluteNode->node->FullPath) + 1]; strcpy((char *)absPath, absoluteNode->node->FullPath); delete absoluteNode; - return fdt->_open(absPath, flags, mode); + int ret = fdt->_open(absPath, flags, mode); + delete[] absPath; + return ret; } if (!fs->PathIsRelative(pPathname))