diff options
| author | Anders Waldenborg | 2017-04-23 21:15:46 +0200 |
|---|---|---|
| committer | Noam Postavsky | 2017-05-31 22:58:30 -0400 |
| commit | c221f1466ed7e0f11f142d9cb3c0247b10e511c6 (patch) | |
| tree | a49bcd9b7b917679047a8cf5ace0422d9995747a /lib-src | |
| parent | 28445aee59d54a8560aa4f33fa50f225b54317dc (diff) | |
| download | emacs-c221f1466ed7e0f11f142d9cb3c0247b10e511c6.tar.gz emacs-c221f1466ed7e0f11f142d9cb3c0247b10e511c6.zip | |
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
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacsclient.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
| 1945 | if (rl < 0) | 1945 | if (rl < 0) |
| 1946 | exit_status = EXIT_FAILURE; | 1946 | exit_status = EXIT_FAILURE; |
| 1947 | 1947 | ||
| 1948 | free (cwd); /* Keep leak checkers happy. */ | ||
| 1949 | |||
| 1948 | CLOSE_SOCKET (emacs_socket); | 1950 | CLOSE_SOCKET (emacs_socket); |
| 1949 | return exit_status; | 1951 | return exit_status; |
| 1950 | } | 1952 | } |