summaryrefslogtreecommitdiffabout
path: root/shared.c
Unidiff
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index 83ded44..8b3a045 100644
--- a/shared.c
+++ b/shared.c
@@ -280,6 +280,10 @@ int cgit_diff_files(const unsigned char *old_sha1,
280 if ((file1.ptr && buffer_is_binary(file1.ptr, file1.size)) || 280 if ((file1.ptr && buffer_is_binary(file1.ptr, file1.size)) ||
281 (file2.ptr && buffer_is_binary(file2.ptr, file2.size))) { 281 (file2.ptr && buffer_is_binary(file2.ptr, file2.size))) {
282 *binary = 1; 282 *binary = 1;
283 if (file1.size)
284 free(file1.ptr);
285 if (file2.size)
286 free(file2.ptr);
283 return 0; 287 return 0;
284 } 288 }
285 289
@@ -292,6 +296,10 @@ int cgit_diff_files(const unsigned char *old_sha1,
292 emit_cb.outf = filediff_cb; 296 emit_cb.outf = filediff_cb;
293 emit_cb.priv = fn; 297 emit_cb.priv = fn;
294 xdl_diff(&file1, &file2, &diff_params, &emit_params, &emit_cb); 298 xdl_diff(&file1, &file2, &diff_params, &emit_params, &emit_cb);
299 if (file1.size)
300 free(file1.ptr);
301 if (file2.size)
302 free(file2.ptr);
295 return 0; 303 return 0;
296} 304}
297 305