check if status_set != NULL before setting it
authorGerd von Egidy <gerd.von.egidy@intra2net.com>
Thu, 17 Dec 2015 09:27:38 +0000 (10:27 +0100)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Thu, 17 Dec 2015 09:27:38 +0000 (10:27 +0100)
src/pipestream.cpp

index d6bf13a..c475a50 100644 (file)
@@ -53,8 +53,10 @@ inpipebuf::~inpipebuf()
     if (pipe != NULL) {
         int pclose_exit = pclose (pipe);
 
-        if (exit_status && pclose_exit != -1) {
-            *status_set = true;
+        if (exit_status && pclose_exit != -1)
+        {
+            if (status_set)
+                *status_set = true;
             *exit_status = pclose_exit;
         }
 
@@ -138,8 +140,10 @@ outpipebuf::~outpipebuf()
     if (pipe != NULL) {
         int pclose_exit = pclose (pipe);
 
-        if (exit_status && pclose_exit != -1) {
-            *status_set = true;
+        if (exit_status && pclose_exit != -1)
+        {
+            if (status_set)
+                *status_set = true;
             *exit_status = pclose_exit;
         }