guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-4-g3e05fc0


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-4-g3e05fc0
Date: Fri, 18 Feb 2011 18:37:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3e05fc04668f2e2c0f0aa989d7adf11bef49ec84

The branch, stable-2.0 has been updated
       via  3e05fc04668f2e2c0f0aa989d7adf11bef49ec84 (commit)
      from  6854c32480e95ca54e95da585e74002d8897573c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3e05fc04668f2e2c0f0aa989d7adf11bef49ec84
Author: Andy Wingo <address@hidden>
Date:   Fri Feb 18 19:28:33 2011 +0100

    fix a couple leaks in ports.c.  thanks valgrind!
    
    * libguile/ports.c (scm_i_remove_port): Fix a case in which ports
      explictly closed via close-port would leak their iconv_t data.
      (scm_set_port_encoding_x): scm_i_set_port_encoding_x strdups its
      argument, so we need to free the locale encoding of the incoming str.

-----------------------------------------------------------------------

Summary of changes:
 libguile/ports.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libguile/ports.c b/libguile/ports.c
index b65650e..6a51ddc 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -661,6 +661,19 @@ scm_i_remove_port (SCM port)
   scm_port_non_buffer (p);
   p->putback_buf = NULL;
   p->putback_buf_size = 0;
+
+  if (p->input_cd != (iconv_t) -1)
+    {
+      iconv_close (p->input_cd);
+      p->input_cd = (iconv_t) -1;
+    }
+  
+  if (p->output_cd != (iconv_t) -1)
+    {
+      iconv_close (p->output_cd);
+      p->output_cd = (iconv_t) -1;
+    }
+
   SCM_SETPTAB_ENTRY (port, 0);
 
   scm_hashq_remove_x (scm_i_port_weak_hash, port);
@@ -2099,6 +2112,7 @@ SCM_DEFINE (scm_set_port_encoding_x, 
"set-port-encoding!", 2, 0, 0,
 
   enc_str = scm_to_locale_string (enc);
   scm_i_set_port_encoding_x (port, enc_str);
+  free (enc_str);
 
   return SCM_UNSPECIFIED;
 }


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]