aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index fc5894e949..041f9ceb52 100644
--- a/remote.c
+++ b/remote.c
@@ -1945,9 +1945,11 @@ static const char *branch_get_push_1(struct repository *repo,
cur = tracking_for_push_dest(remote, branch->refname, err);
if (!cur)
return NULL;
- if (strcmp(cur, up))
+ if (strcmp(cur, up)) {
+ free(cur);
return error_buf(err,
_("cannot resolve 'simple' push to a single destination"));
+ }
return cur;
}
}