all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#26628: [PATCH] Fix memory leak of cwd string in emacsclient
@ 2017-04-23 19:23 Anders Waldenborg
  2017-04-24  9:23 ` Andreas Schwab
  2017-06-01  6:30 ` Paul Eggert
  0 siblings, 2 replies; 5+ messages in thread
From: Anders Waldenborg @ 2017-04-23 19:23 UTC (permalink / raw)
  To: 26628


[-- Attachment #1.1: Type: text/plain, Size: 60 bytes --]

The attached patch fixes a tiny memory leak in emacsclient.

[-- Attachment #1.2: Type: text/html, Size: 111 bytes --]

[-- Attachment #2: 0001-Fix-memory-leak-of-cwd-string-in-emacsclient.patch --]
[-- Type: text/x-patch, Size: 815 bytes --]

From a673aceab4eb0bcfa4e6ff34c02adc453383805b Mon Sep 17 00:00:00 2001
From: Anders Waldenborg <anders@0x63.nu>
Date: Sun, 23 Apr 2017 21:15:46 +0200
Subject: [PATCH] Fix memory leak of cwd string in emacsclient

* 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.
---
 lib-src/emacsclient.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c22b308..3ffb9ea 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1901,6 +1901,8 @@ main (int argc, char **argv)
   if (rl < 0)
     exit_status = EXIT_FAILURE;
 
+  free (cwd);
+
   CLOSE_SOCKET (emacs_socket);
   return exit_status;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-01  6:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-23 19:23 bug#26628: [PATCH] Fix memory leak of cwd string in emacsclient Anders Waldenborg
2017-04-24  9:23 ` Andreas Schwab
2017-04-24 16:05   ` Anders Waldenborg
2017-06-01  2:59   ` npostavs
2017-06-01  6:30 ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.