aboutsummaryrefslogtreecommitdiffhomepage
path: root/exec.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-02-20 12:25:01 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-02-20 12:25:01 -0800
commitc9b4163e231299f68152f96e540fab1162ad5927 (patch)
tree9a63e0da7dbd5b8ab6f3bea2b93066d0efa7c751 /exec.cpp
parentfbedf020bcb41f45b0f7bb848134624ee3748a81 (diff)
Fix a crash when redirecting a nonexistent file to a function
Diffstat (limited to 'exec.cpp')
-rw-r--r--exec.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/exec.cpp b/exec.cpp
index fbbc8825..f64f6212 100644
--- a/exec.cpp
+++ b/exec.cpp
@@ -429,10 +429,10 @@ static bool io_transmogrify(const io_chain_t &in_chain, io_chain_t &out_chain, s
}
}
- /* Record this IO redirection even if we failed (so we can free it) */
- result_chain.push_back(out);
+ if (out.get() != NULL)
+ result_chain.push_back(out);
- /* But don't go any further if we failed */
+ /* Don't go any further if we failed */
if (! success)
{
break;