Commit 59fbf9cfb0633f2968a8d397074456bfbbef0cad

Emilio Cobos Álvarez 2018-03-17T18:29:34

mailmap: Don't return a freed pointer, even if we return an error code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/mailmap.c b/src/mailmap.c
index 54ef720..850b566 100644
--- a/src/mailmap.c
+++ b/src/mailmap.c
@@ -214,8 +214,10 @@ int git_mailmap_parse(
 cleanup:
 	if (entry)
 		git__free(entry);
-	if (error < 0 && *mailmap)
+	if (error < 0 && *mailmap) {
 		git_mailmap_free(*mailmap);
+		*mailmap = NULL;
+	}
 	return error;
 }