Resolve the possible use of negative value (detected by coverity tool)
[platform/upstream/at-spi2-core.git] / bus / at-spi-bus-launcher.c
index b15345b..91bdd48 100644 (file)
@@ -400,8 +400,8 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
   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;