fix for potential resource leak 45/212245/2
authorRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Mon, 19 Aug 2019 08:06:58 +0000 (10:06 +0200)
committerRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Wed, 21 Aug 2019 09:57:09 +0000 (09:57 +0000)
fix for potential memory leak, where pointer memory allocated and
stored in a11y_bus_address property could be overwritten
without releasing.

Change-Id: I0835ec807c96192cc011374b81e2eb14bc910c58

bus/at-spi-bus-launcher.c

index 65bb0b1..b15345b 100644 (file)
@@ -393,6 +393,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
   app->state = A11Y_BUS_STATE_RUNNING;
 
   /* Trim the trailing newline */
+  if (app->a11y_bus_address) g_free(app->a11y_bus_address);
   app->a11y_bus_address = g_strchomp (g_strdup (addr_buf));
   LOGD("a11y bus address: %s", app->a11y_bus_address);