From: Anders Waldenborg Date: Sun, 23 Apr 2017 19:15:46 +0000 (+0200) Subject: Fix memory leak of cwd string in emacsclient (Bug#26628) X-Git-Tag: emacs-26.0.90~521^2~203 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c221f1466ed7e0f11f142d9cb3c0247b10e511c6;p=emacs.git 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 --- 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; }