Fix memory leaks in get_toolkit_name and get_toolkit_version
authorMike Gorse <mgorse@novell.com>
Fri, 6 May 2011 00:39:33 +0000 (19:39 -0500)
committerMike Gorse <mgorse@novell.com>
Fri, 6 May 2011 00:39:33 +0000 (19:39 -0500)
_atspi_dbus_get_property calls g_strdup when it returns a string, so we
should not g_strdup the result unless we're caching a copy for later use.

atspi/atspi-accessible.c

index a12967e..1085b72 100644 (file)
@@ -760,7 +760,7 @@ atspi_accessible_get_toolkit_name (AtspiAccessible *obj, GError **error)
 
   if (!_atspi_dbus_get_property (obj, atspi_interface_application, "ToolkitName", error, "s", &ret))
       return NULL;
-  return g_strdup (ret);
+  return ret;
 }
 
 /**
@@ -782,7 +782,7 @@ atspi_accessible_get_toolkit_version (AtspiAccessible *obj, GError **error)
 
   if (!_atspi_dbus_get_property (obj, atspi_interface_application, "ToolkitVersion", error, "s", &ret))
       return NULL;
-  return g_strdup (ret);
+  return ret;
 }
 
 /**