lua: fix some nasty memory leaks

This commit is contained in:
George Kiagiadakis
2021-01-20 18:57:12 +02:00
parent 7233b7a442
commit b8f8238fb4
2 changed files with 3 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ static int
iterator_next (lua_State *L) iterator_next (lua_State *L)
{ {
WpIterator *it = wplua_checkboxed (L, 1, WP_TYPE_ITERATOR); WpIterator *it = wplua_checkboxed (L, 1, WP_TYPE_ITERATOR);
GValue v = G_VALUE_INIT; g_auto (GValue) v = G_VALUE_INIT;
if (wp_iterator_next (it, &v)) { if (wp_iterator_next (it, &v)) {
return wplua_gvalue_to_lua (L, &v); return wplua_gvalue_to_lua (L, &v);
} else { } else {
@@ -162,7 +162,7 @@ static int
metadata_iterator_next (lua_State *L) metadata_iterator_next (lua_State *L)
{ {
WpIterator *it = wplua_checkboxed (L, 1, WP_TYPE_ITERATOR); WpIterator *it = wplua_checkboxed (L, 1, WP_TYPE_ITERATOR);
GValue item = G_VALUE_INIT; g_auto (GValue) item = G_VALUE_INIT;
if (wp_iterator_next (it, &item)) { if (wp_iterator_next (it, &item)) {
guint32 s = 0; guint32 s = 0;
const gchar *k = NULL, *t = NULL, *v = NULL; const gchar *k = NULL, *t = NULL, *v = NULL;

View File

@@ -96,7 +96,7 @@ function handleEndpoint (session, ep)
end end
-- if not, find a suitable target and link -- if not, find a suitable target and link
target = findTarget (session, ep) local target = findTarget (session, ep)
if target then if target then
local ep_is_output = (ep.direction == "output") local ep_is_output = (ep.direction == "output")
local target_id = target['bound-id'] local target_id = target['bound-id']