Added missing error handling path
diff --git a/src/diff.c b/src/diff.c
index 1f3ee63..e23d389 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1555,6 +1555,7 @@ int git_diff_format_email(
if ((offset = (loc - opts->summary)) == 0) {
giterr_set(GITERR_INVALID, "summary is empty");
error = -1;
+ goto on_error;
}
summary = git__calloc(offset + 1, sizeof(char));