Don't try to clean up uninitialized Lua and crash

Reported to Debian BTS at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786704

Change-Id: I3045a68f0dd557bf64ea26a488a1bcece4828fec
Reviewed-on: https://code.wireshark.org/review/8765
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
This commit is contained in:
Balint Reczey 2015-06-04 19:30:35 +02:00 committed by Alexis La Goutte
parent 41ac67cbb2
commit e187b5396e
1 changed files with 4 additions and 2 deletions

View File

@ -910,8 +910,10 @@ int wslua_init(register_cb cb, gpointer client_data) {
int wslua_cleanup(void) {
/* cleanup lua */
lua_close(L);
L = NULL;
if (!L) {
lua_close(L);
L = NULL;
}
return 0;
}