Hi folks,
In epan/wslua/wslua_gui.c, we see this:
for (i = 1; i <= top; i++) {
gchar* label = (void*)luaL_checkstring(L,i);
/* XXX leaks labels on error */
if (! label)
WSLUA_ERROR(new_dialog,"All fields must be strings");
g_ptr_array_add(labels,label);
}
The obvious solution would seem to be:
for (i = 1; i <= top; i++) {
gchar* label = (void*)luaL_checkstring(L,i);
/* no more leaks of labels on error */
if (! label) {
g_ptr_array_free(labels, FALSE);
WSLUA_ERROR(new_dialog,"All fields must be strings");
}
g_ptr_array_add(labels,label);
}
--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)