diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-08-22 21:41:48 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-08-22 21:41:48 +0400 |
commit | b90267a71cc8cdc8b38675322ef9fa7a9cb5468c (patch) | |
tree | 3bff8af523d19ec9cff93134b067fc404795000d /src/lua/lua_xmlrpc.c | |
parent | ed224e6a3530f54b5993e39066a8397d54e9517e (diff) | |
download | rspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.tar.gz rspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.zip |
* Rework thread pools locking logic to avoid global lua mutex usage.
Fixed several memory leaks with modern glib.
Fixed memory leak in dkim code.
Fixed a problem with static global variables in shared libraries.
Diffstat (limited to 'src/lua/lua_xmlrpc.c')
-rw-r--r-- | src/lua/lua_xmlrpc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lua/lua_xmlrpc.c b/src/lua/lua_xmlrpc.c index 6ef9be7e4..e9b317517 100644 --- a/src/lua/lua_xmlrpc.c +++ b/src/lua/lua_xmlrpc.c @@ -353,11 +353,11 @@ xmlrpc_text (GMarkupParseContext *context, const gchar *text, gsize text_len, gp gdouble dnum; /* Strip line */ - while (g_ascii_isspace (*text) && text_len > 0) { + while (text_len > 0 && g_ascii_isspace (*text)) { text ++; text_len --; } - while (g_ascii_isspace (text[text_len - 1]) && text_len > 0) { + while (text_len > 0 && g_ascii_isspace (text[text_len - 1])) { text_len --; } @@ -417,12 +417,16 @@ lua_xmlrpc_parse_reply (lua_State *L) G_MARKUP_TREAT_CDATA_AS_TEXT, &ud, NULL); res = g_markup_parse_context_parse (ctx, data, s, &err); + g_markup_parse_context_free (ctx); if (! res) { - lua_pushnil (L); + lua_pushboolean (L, FALSE); + } + else { + lua_pushboolean (L, TRUE); } } else { - lua_pushnil (L); + lua_pushboolean (L, FALSE); } return 1; |