Software /
code /
prosody
Diff
util-src/encodings.c @ 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 |
parent | 896:2c0b9e3c11c3 |
child | 1844:a4a8fe2a560c |
child | 1854:7e055cc6bc90 |
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 } }