From c9b4163e231299f68152f96e540fab1162ad5927 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 20 Feb 2013 12:25:01 -0800 Subject: [PATCH] Fix a crash when redirecting a nonexistent file to a function https://github.com/fish-shell/fish-shell/pull/574 --- exec.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exec.cpp b/exec.cpp index fbbc88254..f64f62123 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;