From 4f2b31396807dc3fa87c77cace1574d9d008d497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6ppe?= Date: Thu, 31 Aug 2000 15:27:58 +0000 Subject: [PATCH] Free malloc'ed string copies after function call. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@753 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/guile/typemaps.i | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/guile/typemaps.i b/Lib/guile/typemaps.i index 27f14bb56..65b18170d 100644 --- a/Lib/guile/typemaps.i +++ b/Lib/guile/typemaps.i @@ -43,6 +43,11 @@ SIMPLE_MAP(double, gh_scm2double, gh_double2scm, real); SIMPLE_MAP(char *, GSWIG_scm2str, gh_str02scm, string); +/* GSWIG_scm2str makes a malloc'ed copy of the string, so get rid of it after + the function call. */ + +%typemap (guile, freearg) char * "if ($target) scm_must_free($target);"; + /* Void */ %typemap (guile, out) void "gswig_result = GH_UNSPECIFIED;";