[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: stable-1.8 updated (1.7.2-20111231-69-gd006915)



The branch, stable-1.8 has been updated
       via  d006915458a097cef78aa738d3123e88eeab9c7f (commit)
       via  f86efb8f2d426810c6405f4a9696280e1cf63215 (commit)
       via  cfaf93e4a1fd5592ed40caf7ed643a7011f8d727 (commit)
      from  321c005a6170b34fc9f3e9f6ab1e4ab931120f81 (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.


=========
 Summary
=========

 gschem/src/g_funcs.c |    9 +++++----
 gschem/src/g_rc.c    |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)


=================
 Commit Messages
=================

commit f86efb8f2d426810c6405f4a9696280e1cf63215
Author: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>
Commit: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>

    gschem: fix potential memory leak in g_funcs_filesel()
    
    Guard against non-local guile exit using a dynamic context.

:100644 100644 8d8f44b... e0dab34... M	gschem/src/g_funcs.c

commit cfaf93e4a1fd5592ed40caf7ed643a7011f8d727
Author: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>
Commit: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>

    gschem: Fix potential memory leak in g_rc_paper_sizes()
    
    Move the conversion of the "papername" string from a Scheme object to
    be the last Scheme call in the function, so that no potential
    non-local exits in guile could cause the string not to be freed.

:100644 100644 33731bf... b7d28f4... M	gschem/src/g_rc.c

=========
 Changes
=========

commit f86efb8f2d426810c6405f4a9696280e1cf63215
Author: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>
Commit: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>

    gschem: fix potential memory leak in g_funcs_filesel()
    
    Guard against non-local guile exit using a dynamic context.

diff --git a/gschem/src/g_funcs.c b/gschem/src/g_funcs.c
index 8d8f44b..e0dab34 100644
--- a/gschem/src/g_funcs.c
+++ b/gschem/src/g_funcs.c
@@ -248,17 +248,18 @@ SCM g_funcs_filesel(SCM scm_msg, SCM scm_templ, SCM scm_flags)
     free(flag);
   }
 
+  scm_dynwind_begin (0);
   msg = scm_to_utf8_string (scm_msg);
+  scm_dynwind_free (msg);
   templ = scm_to_utf8_string (scm_templ);
+  scm_dynwind_free (templ);
 
   r = generic_filesel_dialog (msg, templ, c_flags);
-
-  free(msg);
-  free(templ);
+  scm_dynwind_unwind_handler (g_free, r, SCM_F_WIND_EXPLICITLY);
 
   v = scm_from_utf8_string (r);
-  g_free (r);
 
+  scm_dynwind_end();
   return v;
 }
 

commit cfaf93e4a1fd5592ed40caf7ed643a7011f8d727
Author: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>
Commit: Gareth Edwards <gareth@xxxxxxxxxxxxxxxxxxxx>

    gschem: Fix potential memory leak in g_rc_paper_sizes()
    
    Move the conversion of the "papername" string from a Scheme object to
    be the last Scheme call in the function, so that no potential
    non-local exits in guile could cause the string not to be freed.

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 33731bf..b7d28f4 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -610,9 +610,9 @@ SCM g_rc_paper_sizes(SCM scm_papername, SCM scm_width, SCM scm_height)
   SCM_ASSERT (SCM_NIMP (scm_height) && SCM_REALP (scm_height), scm_height,
               SCM_ARG3, FUNC_NAME);
 
-  papername = scm_to_utf8_string (scm_papername);
   width  = (int) (scm_to_double (scm_width)  * MILS_PER_INCH);
   height = (int) (scm_to_double (scm_height) * MILS_PER_INCH);
+  papername = scm_to_utf8_string (scm_papername);
 
   if (!s_papersizes_uniq(papername)) {
     ret = SCM_BOOL_F;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs