[mw-devel] MW3 r950 - trunk/src

arthur at sucs.org arthur at sucs.org
Sat Apr 21 16:29:59 BST 2007


Author: arthur
Date: 2007-04-21 16:29:59 +0100 (Sat, 21 Apr 2007)
New Revision: 950

Modified:
   trunk/src/js.c
Log:
memory leak in js strings


Modified: trunk/src/js.c
===================================================================
--- trunk/src/js.c	2007-04-19 16:30:08 UTC (rev 949)
+++ trunk/src/js.c	2007-04-21 15:29:59 UTC (rev 950)
@@ -508,6 +508,7 @@
 			} else {
 				argv[i] = STRING_TO_JSVAL(JS_NewString(jscx, "(Garbled string)", 16));
 			}
+		if (js_string) JS_free(jscx, js_string);
 	}
 	
 	ret = JS_CallFunctionName(jscx, jsroot, name, argc, argv, &rval);
@@ -518,8 +519,8 @@
 	if (JSVAL_IS_BOOLEAN(rval) && JSVAL_TO_BOOLEAN(rval)==0) {
 		script_output=0;
 	}
-	JS_free(jscx, js_string);
 	free(argv);
+	JS_GC(jscx);
 	return ret ? 1 : 0;
 }
 





More information about the mw-devel mailing list