vlc | branch: master | Hugo Beauzée-Luyssen <h...@beauzee.fr> | Tue Oct 24 
16:43:55 2017 +0200| [11cd9c27beb5614c5923c78429c37b8db1237d9a] | committer: 
Hugo Beauzée-Luyssen

netconf: Don't ignore posix_spawn_* errors

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11cd9c27beb5614c5923c78429c37b8db1237d9a
---

 src/posix/netconf.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/posix/netconf.c b/src/posix/netconf.c
index 1ce6526711..e2db67b386 100644
--- a/src/posix/netconf.c
+++ b/src/posix/netconf.c
@@ -55,10 +55,15 @@ char *vlc_getProxyUrl(const char *url)
     if (vlc_pipe(fd))
         return NULL;
 
-    posix_spawn_file_actions_init(&actions);
-    posix_spawn_file_actions_addopen(&actions, STDIN_FILENO, "/dev/null",
-                                     O_RDONLY, 0644);
-    posix_spawn_file_actions_adddup2(&actions, fd[1], STDOUT_FILENO);
+    if (posix_spawn_file_actions_init(&actions))
+        return NULL;
+    if (posix_spawn_file_actions_addopen(&actions, STDIN_FILENO, "/dev/null",
+                                         O_RDONLY, 0644) ||
+        posix_spawn_file_actions_adddup2(&actions, fd[1], STDOUT_FILENO))
+    {
+        posix_spawn_file_actions_destroy(&actions);
+        return NULL;
+    }
 
     posix_spawnattr_init(&attr);
     {

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to