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
This commit is contained in:
Anders Waldenborg 2017-04-23 21:15:46 +02:00 committed by Noam Postavsky
parent 28445aee59
commit c221f1466e

View file

@ -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;
}