[grilo-plugins] lua-factory: Fix use-after-free
- From: Victor Toso de Carvalho <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] lua-factory: Fix use-after-free
- Date: Wed, 26 Nov 2014 23:43:00 +0000 (UTC)
commit 5a8e01ddb34d8b548fc895941692bc56b5fd8976
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 26 17:48:05 2014 +0100
lua-factory: Fix use-after-free
When the key type isn't handled, we try to print the key name. Better
for it not to be freed when we do that.
https://bugzilla.gnome.org/show_bug.cgi?id=740765
src/lua-factory/grl-lua-library.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/lua-factory/grl-lua-library.c b/src/lua-factory/grl-lua-library.c
index 711e148..6f06018 100644
--- a/src/lua-factory/grl-lua-library.c
+++ b/src/lua-factory/grl-lua-library.c
@@ -796,7 +796,6 @@ grl_l_media_get_keys (lua_State *L)
}
lua_pushstring (L, key_name);
- g_free (key_name);
if (key_id != GRL_METADATA_KEY_INVALID) {
type = grl_registry_lookup_metadata_key_type (registry, key_id);
switch (type) {
@@ -819,12 +818,14 @@ grl_l_media_get_keys (lua_State *L)
} else {
GRL_DEBUG ("'%s' is being ignored as G_TYPE is not being handled.",
key_name);
+ g_free (key_name);
lua_pop (L, 1);
continue;
}
}
lua_settable (L, -3);
}
+ g_free (key_name);
}
g_list_free (list_keys);
return 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]