summaryrefslogtreecommitdiff
path: root/src/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 19afddcd8..276591821 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -72,7 +72,10 @@ static int filter_wants(git_remote *remote)
if ((error = git_refspec__parse(&head, "HEAD", true)) < 0)
goto cleanup;
- if ((error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs)) < 0)
+ error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs);
+ git_refspec__free(&head);
+
+ if (error < 0)
goto cleanup;
}