spa-json: fix coverity scan issues

This commit is contained in:
Julian Bouzas
2022-01-25 21:18:16 -05:00
parent 5bef0f240f
commit 46ab414a04
2 changed files with 4 additions and 2 deletions

View File

@@ -822,7 +822,8 @@ wp_spa_json_object_get_valist (WpSpaJson *self, va_list args)
g_return_val_if_fail (key_str, FALSE);
g_value_unset (&item);
wp_iterator_next (it, &item);
if (!wp_iterator_next (it, &item))
return FALSE;
value = g_value_get_boxed (&item);
if (g_strcmp0 (key_str, lookup_key) == 0) {

View File

@@ -145,7 +145,8 @@ push_luajson (lua_State *L, WpSpaJson *json)
key_str = wp_spa_json_parse_string (key);
g_warn_if_fail (key_str);
g_value_unset (&item);
wp_iterator_next (it, &item);
if (!wp_iterator_next (it, &item))
break;
value = g_value_get_boxed (&item);
push_luajson (L, value);
lua_setfield (L, -2, key_str);