diff options
author | Hadriel Kaplan <hadriel@128technology.com> | 2014-12-29 00:21:15 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-01-04 21:02:38 +0000 |
commit | fac8356610fadf488ff92c5a22e5177bb33a2511 (patch) | |
tree | af8a1ceec7eb91c5a6a5e6e2ac14621425125e65 /epan/wslua/wslua_listener.c | |
parent | 5653fcedca8491829d6d6ce480e7fba13ff801d7 (diff) | |
download | wireshark-fac8356610fadf488ff92c5a22e5177bb33a2511.tar.gz |
Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or
simpler methods.
Bug: 9927
Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55
Reviewed-on: https://code.wireshark.org/review/6109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/wslua/wslua_listener.c')
-rw-r--r-- | epan/wslua/wslua_listener.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c index 5e0deb6307..dd76825b0e 100644 --- a/epan/wslua/wslua_listener.c +++ b/epan/wslua/wslua_listener.c @@ -28,8 +28,6 @@ #include "config.h" -#include <epan/emem.h> - /* WSLUA_MODULE Listener Post-dissection packet analysis */ #include "wslua.h" @@ -47,9 +45,8 @@ static int tap_packet_cb_error_handler(lua_State* L) { static int repeated = 0; static int next = 2; const gchar* where = (lua_pinfo) ? - - ep_strdup_printf("Lua: on packet %i Error During execution of Listener Packet Callback",lua_pinfo->fd->num) : - ep_strdup_printf("Lua: Error During execution of Listener Packet Callback") ; + wmem_strdup_printf(NULL, "Lua: on packet %i Error During execution of Listener Packet Callback",lua_pinfo->fd->num) : + wmem_strdup_printf(NULL, "Lua: Error During execution of Listener Packet Callback") ; /* show the error the 1st, 3rd, 5th, 9th, 17th, 33th... time it appears to avoid window flooding */ /* XXX the last series of identical errors won't be shown (the user however gets at least one message) */ @@ -59,6 +56,8 @@ static int tap_packet_cb_error_handler(lua_State* L) { last_error = g_strdup(error); repeated = 0; next = 2; + wmem_free(NULL, (void*) where); + where = NULL; return 0; } @@ -77,6 +76,7 @@ static int tap_packet_cb_error_handler(lua_State* L) { report_failure("%s:\n %s",where,error); } + wmem_free(NULL, (void*) where); return 0; } @@ -288,10 +288,8 @@ WSLUA_METHOD Listener_remove(lua_State* L) { WSLUA_METAMETHOD Listener__tostring(lua_State* L) { /* Generates a string of debug info for the tap `Listener`. */ Listener tap = checkListener(L,1); - gchar* str; - str = ep_strdup_printf("Listener(%s) filter: %s",tap->name, tap->filter ? tap->filter : "NONE"); - lua_pushstring(L,str); + lua_pushfstring(L,"Listener(%s) filter: %s",tap->name, tap->filter ? tap->filter : "NONE"); return 1; } |