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);
return TRUE;
error:
- close (app->pipefd[0]);
- close (app->pipefd[1]);
+ if (app->pipefd[0] > 0) close (app->pipefd[0]);
+ if (app->pipefd[1] > 0) close (app->pipefd[1]);
app->state = A11Y_BUS_STATE_ERROR;
return FALSE;