From c221f1466ed7e0f11f142d9cb3c0247b10e511c6 Mon Sep 17 00:00:00 2001 From: Anders Waldenborg Date: Sun, 23 Apr 2017 21:15:46 +0200 Subject: Fix memory leak of cwd string in emacsclient (Bug#26628) * lib-src/emacsclient.c (main): emacsclient retrieves the current working directory using get_current_dir_name which returns a newly allocated string. Make sure this string is freed before exiting. Copyright-paperwork-exempt: yes --- lib-src/emacsclient.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib-src') diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index c21ee6bd395..3a0715f137e 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1945,6 +1945,8 @@ main (int argc, char **argv) if (rl < 0) exit_status = EXIT_FAILURE; + free (cwd); /* Keep leak checkers happy. */ + CLOSE_SOCKET (emacs_socket); return exit_status; } -- cgit v1.2.3