Merge branch 'rs/mailinfo-qp-decode-fix'
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 7df2227a3c9af562305fe91e532d9c56759809d0..3c6a3e0faa58f810ce2fe8b27f62581c175edf64 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2583,6 +2583,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
        }
 
        print_stat_summary_inserts_deletes(options, total_files, adds, dels);
+       strbuf_release(&out);
 }
 
 static void show_shortstats(struct diffstat_t *data, struct diff_options *options)
@@ -3737,7 +3738,7 @@ static void prep_temp_blob(const char *path, struct diff_tempfile *temp,
                blob = buf.buf;
                size = buf.len;
        }
-       if (write_in_full(temp->tempfile->fd, blob, size) != size ||
+       if (write_in_full(temp->tempfile->fd, blob, size) < 0 ||
            close_tempfile_gently(temp->tempfile))
                die_errno("unable to write temp-file");
        temp->name = get_tempfile_path(temp->tempfile);
@@ -5288,6 +5289,7 @@ static void show_rename_copy(struct diff_options *opt, const char *renamecopy,
        emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY,
                                 sb.buf, sb.len, 0);
        show_mode_change(opt, p, 0);
+       strbuf_release(&sb);
 }
 
 static void diff_summary(struct diff_options *opt, struct diff_filepair *p)
@@ -5313,6 +5315,7 @@ static void diff_summary(struct diff_options *opt, struct diff_filepair *p)
                        strbuf_addf(&sb, " (%d%%)\n", similarity_index(p));
                        emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY,
                                         sb.buf, sb.len, 0);
+                       strbuf_release(&sb);
                }
                show_mode_change(opt, p, !p->score);
                break;