browser-plugin: Fix memory leak when passing an invalid UUID

https://bugzilla.gnome.org/show_bug.cgi?id=665261
This commit is contained in:
Jasper St. Pierre 2011-12-06 15:00:52 -05:00
parent 102f2a91f9
commit 02af8eb824

View File

@ -480,7 +480,10 @@ plugin_install_extension (PluginObject *obj,
{ {
gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length); gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
if (!uuid_is_valid (uuid_str)) if (!uuid_is_valid (uuid_str))
{
g_free (uuid_str);
return FALSE; return FALSE;
}
g_dbus_proxy_call (obj->proxy, g_dbus_proxy_call (obj->proxy,
"InstallRemoteExtension", "InstallRemoteExtension",
@ -509,7 +512,10 @@ plugin_uninstall_extension (PluginObject *obj,
uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length); uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
if (!uuid_is_valid (uuid_str)) if (!uuid_is_valid (uuid_str))
{
g_free (uuid_str);
return FALSE; return FALSE;
}
res = g_dbus_proxy_call_sync (obj->proxy, res = g_dbus_proxy_call_sync (obj->proxy,
"UninstallExtension", "UninstallExtension",
@ -543,7 +549,10 @@ plugin_get_info (PluginObject *obj,
uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length); uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
if (!uuid_is_valid (uuid_str)) if (!uuid_is_valid (uuid_str))
{
g_free (uuid_str);
return FALSE; return FALSE;
}
res = g_dbus_proxy_call_sync (obj->proxy, res = g_dbus_proxy_call_sync (obj->proxy,
"GetExtensionInfo", "GetExtensionInfo",
@ -576,7 +585,10 @@ plugin_get_errors (PluginObject *obj,
uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length); uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
if (!uuid_is_valid (uuid_str)) if (!uuid_is_valid (uuid_str))
{
g_free (uuid_str);
return FALSE; return FALSE;
}
res = g_dbus_proxy_call_sync (obj->proxy, res = g_dbus_proxy_call_sync (obj->proxy,
"GetExtensionErrors", "GetExtensionErrors",