[PATCH 7/7] child_spawn: fix possible fd_close() on uninited syncpipe

From: Roman I Khimov <khimov_at_altell.ru>
Date: Fri, 13 Mar 2015 17:24:26 +0300

Jumping to errsp is wrong here as syncpipe isn't inited yet.

Found by Clang's scan-build.
---
 src/libstddjb/child_spawn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstddjb/child_spawn.c b/src/libstddjb/child_spawn.c
index 7490e7d..f060be3 100644
--- a/src/libstddjb/child_spawn.c
+++ b/src/libstddjb/child_spawn.c
_at_@ -57,7 +57,7 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const
   for (i = 0 ; i < n ; i++)
     if ((ndelay_on(p[i][i & 1]) < 0) || (coe(p[i][i & 1]) < 0))
     {
-      e = errno ; goto errsp ;
+      e = errno ; goto errp ;
     }
   for (i = 2 ; i < n ; i++)
   {
-- 
2.1.4
Received on Fri Mar 13 2015 - 14:24:26 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC