]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix memory leak of cwd string in emacsclient (Bug#26628)
authorAnders Waldenborg <anders@0x63.nu>
Sun, 23 Apr 2017 19:15:46 +0000 (21:15 +0200)
committerNoam Postavsky <npostavs@gmail.com>
Thu, 1 Jun 2017 02:58:30 +0000 (22:58 -0400)
* 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

index c21ee6bd39588073623f062b6dc1489ea05da66b..3a0715f137e8c6fb0813b7e43d90bcba3baa0ec5 100644 (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;
 }