Fix memory management issues
[platform/upstream/at-spi2-core.git] / atspi / atspi-mutter.c
index 4445c18..532c1ab 100644 (file)
@@ -80,7 +80,7 @@ ensure_rd_session_path (GError **error)
   dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, MUTTER_REMOTE_DESKTOP_OBJECT_PATH, MUTTER_REMOTE_DESKTOP_INTERFACE, "CreateSession", &d_error, "=>o", &session_path);
 
   data.rd_session_path = g_strdup (session_path);
-  if (!data.rd_session_path[0])
+  if (!data.rd_session_path || !data.rd_session_path[0])
     return FALSE;
 
   dbind_method_call_reentrant (data.bus, MUTTER_REMOTE_DESKTOP_BUS_NAME, data.rd_session_path, MUTTER_REMOTE_DESKTOP_SESSION_INTERFACE, "Start", &d_error, "");
@@ -398,6 +398,7 @@ _atspi_mutter_set_reference_window (AtspiAccessible *accessible)
     name = atspi_accessible_get_name (accessible, NULL);
     data.window_id = get_window_id (name);
     data.window_id_is_explicit = TRUE;
+    g_free(name);
   }
 
   else