summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-03-17 18:29:34 +0100
committerNika Layzell <nika@thelayzells.com>2018-06-14 22:43:27 -0700
commit59fbf9cfb0633f2968a8d397074456bfbbef0cad (patch)
tree474e1887b13946c9fbc0e0c7e32960d859f26fe5
parent97bc898828f8a281f292cef8913e6ec2dc13eef9 (diff)
downloadlibgit2-59fbf9cfb0633f2968a8d397074456bfbbef0cad.tar.gz
mailmap: Don't return a freed pointer, even if we return an error code
-rw-r--r--src/mailmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailmap.c b/src/mailmap.c
index 54ef72066..850b566ce 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;
}