From 5a943ce5a58765cac294d95333ac9ed59248c31a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 8 Apr 2023 04:50:56 -0700 Subject: [PATCH] util: Add a missing free() to m5term. The "cwd" string is used to store the previous working directory, if m5term needs to change it to maximize the space it has to create a unix domain socket using a relative path. That string was not being freed, which is a small memory leak. This change frees that memory. Change-Id: I1ad901e7c59614dd938165cae91c3f666d86e872 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69557 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- util/term/term.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/term/term.c b/util/term/term.c index cf3fdda9b2..b1624b28be 100644 --- a/util/term/term.c +++ b/util/term/term.c @@ -235,6 +235,7 @@ remote_connect_unix(const char *cpath) perror("chdir back failed:"); exit(1); } + free(cwd); } // Return the FD of our new connection.