Commit 5387cfee4cf4c4c0410e947f27555d0a6e87dc81

Jacques Germishuys 2014-09-25T15:29:35

Ensure patch is initialized to zero, otherwise, the allocated flag may be set

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/diff_patch.c b/src/diff_patch.c
index 38d5f42..4e0672a 100644
--- a/src/diff_patch.c
+++ b/src/diff_patch.c
@@ -274,6 +274,7 @@ int git_diff_foreach(
 		return error;
 
 	memset(&xo, 0, sizeof(xo));
+	memset(&patch, 0, sizeof(patch));
 	diff_output_init(
 		&xo.output, &diff->opts, file_cb, hunk_cb, data_cb, payload);
 	git_xdiff_init(&xo, &diff->opts);