GNU bug report logs - #26628
[PATCH] Fix memory leak of cwd string in emacsclient

Previous Next

Package: emacs;

Reported by: Anders Waldenborg <anders <at> 0x63.nu>

Date: Sun, 23 Apr 2017 19:24:01 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Anders Waldenborg <anders <at> 0x63.nu>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 26628 <at> debbugs.gnu.org
Subject: bug#26628: [PATCH] Fix memory leak of cwd string in emacsclient
Date: Mon, 24 Apr 2017 18:05:51 +0200
On Mon, Apr 24, 2017 at 11:23:26AM +0200, Andreas Schwab wrote:
> > * 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.
> 
> There is no need to free it since the process exists right away anyway.

Yes. Unless you compile with -fsanitize=address and this leak makes
emacsclient mostly unusable as the asan leak checker will change the
return code to non-zero (yes I'm aware that I can set
ASAN_OPTIONS=detect_leaks=0 in the environment).

 anders




This bug report was last modified 8 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.