Skip to content
/ gem5 Public
forked from gem5/gem5

Commit

Permalink
util: Add a missing free() to m5term.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
  • Loading branch information
gabemblack authored and Gabe Black committed Apr 8, 2023
1 parent d632bba commit 5a943ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions util/term/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5a943ce

Please sign in to comment.