Changeset

1829:3d0db768be2f

util.encodings: Fixed an issue with cross-module memory deallocation (crashes on some windows versions).
author Waqas Hussain <waqas20@gmail.com>
date Tue, 22 Sep 2009 22:21:15 +0500
parents 1813:2683cdaf6dc8
children 1830:dc4d47d91d66
files util-src/encodings.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/util-src/encodings.c	Mon Sep 21 17:59:21 2009 +0100
+++ b/util-src/encodings.c	Tue Sep 22 22:21:15 2009 +0500
@@ -172,11 +172,11 @@
 	int ret = idna_to_ascii_8z(s, &output, 0);
 	if (ret == IDNA_SUCCESS) {
 		lua_pushstring(L, output);
-		if (output) free(output);
+		idn_free(output);
 		return 1;
 	} else {
 		lua_pushnil(L);
-		if (output) free(output);
+		idn_free(output);
 		return 1; // TODO return error message
 	}
 }
@@ -189,11 +189,11 @@
 	int ret = idna_to_unicode_8z8z(s, &output, 0);
 	if (ret == IDNA_SUCCESS) {
 		lua_pushstring(L, output);
-		if (output) free(output);
+		idn_free(output);
 		return 1;
 	} else {
 		lua_pushnil(L);
-		if (output) free(output);
+		idn_free(output);
 		return 1; // TODO return error message
 	}
 }