diff options
author | Justus Winter <[email protected]> | 2016-06-30 15:23:48 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-06-30 16:50:16 +0000 |
commit | 9037c23979866e6e085b3e32f973bcba590a2635 (patch) | |
tree | 5f8634a8eaeaa9e82b72f8ef42599d2cdb10a650 | |
parent | g10: Fix keybox-related memory leaks. (diff) | |
download | gnupg-9037c23979866e6e085b3e32f973bcba590a2635.tar.gz gnupg-9037c23979866e6e085b3e32f973bcba590a2635.zip |
common: Fix memory leak.
* common/simple-pwquery.c (agent_open): Free socket path.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | common/simple-pwquery.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c index bdad14093..708b1573d 100644 --- a/common/simple-pwquery.c +++ b/common/simple-pwquery.c @@ -340,6 +340,7 @@ agent_open (int *rfd) if ( !(p = strchr ( infostr, PATHSEP_C)) || p == infostr || (p-infostr)+1 >= sizeof client_addr.sun_path ) { + spwq_free (infostr); return SPWQ_NO_AGENT; } *p++ = 0; @@ -357,12 +358,14 @@ agent_open (int *rfd) #ifdef SPWQ_USE_LOGGING log_error ("can't create socket: %s\n", strerror(errno) ); #endif + spwq_free (infostr); return SPWQ_SYS_ERROR; } memset (&client_addr, 0, sizeof client_addr); client_addr.sun_family = AF_UNIX; strcpy (client_addr.sun_path, infostr); + spwq_free (infostr); len = SUN_LEN (&client_addr); #ifdef HAVE_W32_SYSTEM @@ -373,7 +376,8 @@ agent_open (int *rfd) if (rc == -1) { #ifdef SPWQ_USE_LOGGING - log_error ( _("can't connect to '%s': %s\n"), infostr, strerror (errno)); + log_error (_("can't connect to '%s': %s\n"), + client_addr.sun_path, strerror (errno)); #endif close (fd ); return SPWQ_IO_ERROR; |