changeset 767:9d430b084a13

Free string allocated by code generator
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 29 Aug 2010 17:16:57 +0800
parents be0e02948c1d
children 13669b28826d
files nodejs/shapes.cc
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/shapes.cc	Sun Aug 29 13:34:40 2010 +0800
+++ b/nodejs/shapes.cc	Sun Aug 29 17:16:57 2010 +0800
@@ -256,6 +256,8 @@
     
     rdman = X_njs_MB_rdman(rt);
     sh = rdman_shape_path_new(rdman, d);
+    /* Code generator supposes that callee should free the memory */
+    free((void *)d);
     
     return sh;
 }
@@ -267,6 +269,8 @@
 
     rdman = X_njs_MB_rdman(rt);
     sh = rdman_shape_stext_new(rdman, txt, x, y);
+    /* Code generator supposes that callee should free the memory */
+    free((void *)txt);
 
     return sh;
 }