summaryrefslogtreecommitdiff
path: root/epan/wslua/wslua_proto.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-01-31 02:25:42 -0500
committerEvan Huus <eapache@gmail.com>2014-01-31 16:31:59 +0000
commit3d59ff9e95aab13cadd046afcc36cb8c290b6e62 (patch)
treea1a49ef007d737f86dba0a9a8f73100e4fb4815f /epan/wslua/wslua_proto.c
parenta94d127b771da2a7353ad26d8a70c4fe2cbc32fe (diff)
downloadwireshark-3d59ff9e95aab13cadd046afcc36cb8c290b6e62.tar.gz
Fix for Bug-9711 Lua: the Lua stack is growing slightly during initialization.
Change-Id: I689319c0071fdb42583e8bd7633d8f0660c92f1b Reviewed-on: https://code.wireshark.org/review/51 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/wslua/wslua_proto.c')
-rw-r--r--epan/wslua/wslua_proto.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index 50df680b1d..98d2262a53 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -263,7 +263,7 @@ WSLUA_META Pref_meta[] = {
WSLUA_REGISTER Pref_register(lua_State* L) {
WSLUA_REGISTER_CLASS(Pref);
- return 1;
+ return 0;
}
WSLUA_CLASS_DEFINE(Prefs,NOP,NOP); /* The table of preferences of a protocol */
@@ -427,7 +427,7 @@ WSLUA_META Prefs_meta[] = {
WSLUA_REGISTER Prefs_register(lua_State* L) {
WSLUA_REGISTER_META(Prefs);
- return 1;
+ return 0;
}
WSLUA_CLASS_DEFINE(ProtoField,FAIL_ON_NULL("null ProtoField"),NOP);
@@ -1332,7 +1332,7 @@ static const luaL_Reg ProtoField_meta[] = {
int ProtoField_register(lua_State* L) {
WSLUA_REGISTER_CLASS(ProtoField);
- return 1;
+ return 0;
}
WSLUA_CLASS_DEFINE(Proto,NOP,NOP);
@@ -1665,7 +1665,7 @@ int Proto_register(lua_State* L) {
lua_pushcfunction(L, Proto_new);
lua_setglobal(L, "Proto");
- return 1;
+ return 0;
}
/**
@@ -1732,6 +1732,8 @@ int Proto_commit(lua_State* L) {
g_array_free(etta,FALSE);
}
+ lua_pop(L,1); /* pop the protocols_table_ref */
+
return 0;
}
@@ -1810,7 +1812,7 @@ static const luaL_Reg Dissector_meta[] = {
int Dissector_register(lua_State* L) {
WSLUA_REGISTER_CLASS(Dissector);
- return 1;
+ return 0;
}
WSLUA_CLASS_DEFINE(DissectorTable,NOP,NOP);
@@ -2214,5 +2216,5 @@ static const luaL_Reg DissectorTable_meta[] = {
int DissectorTable_register(lua_State* L) {
WSLUA_REGISTER_CLASS(DissectorTable);
- return 1;
+ return 0;
}