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 <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Gabe Black
2023-04-08 04:50:56 -07:00
committed by Gabe Black
parent d632bba119
commit 5a943ce5a5

View File

@@ -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.