From d00589a0ae3b87d8d4048f77610713f049f136f5 Mon Sep 17 00:00:00 2001 From: Gerd von Egidy Date: Thu, 17 Dec 2015 10:27:38 +0100 Subject: [PATCH] check if status_set != NULL before setting it --- src/pipestream.cpp | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pipestream.cpp b/src/pipestream.cpp index d6bf13a..c475a50 100644 --- a/src/pipestream.cpp +++ b/src/pipestream.cpp @@ -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; } -- 1.7.1