worktree: check the result of read_in_full()
[gitweb.git] / convert.c
index 02962261c58f71485a27f9799a5db29ec77e0bc7..a09935cb8123f04a8fdb4d48157c2a98e67b3c64 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -423,8 +423,10 @@ static int filter_buffer_or_fd(int in, int out, void *data)
        child_process.in = -1;
        child_process.out = out;
 
-       if (start_command(&child_process))
+       if (start_command(&child_process)) {
+               strbuf_release(&cmd);
                return error("cannot fork to run external filter '%s'", params->cmd);
+       }
 
        sigchain_push(SIGPIPE, SIG_IGN);