diff options
Diffstat (limited to 'object-name.c')
| -rw-r--r-- | object-name.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/object-name.c b/object-name.c index 3a2ef5d680..638608523d 100644 --- a/object-name.c +++ b/object-name.c @@ -1479,7 +1479,7 @@ int repo_get_oid_mb(struct repository *r, struct object_id *oid) { struct commit *one, *two; - struct commit_list *mbs; + struct commit_list *mbs = NULL; struct object_id oid_tmp; const char *dots; int st; @@ -1507,7 +1507,10 @@ int repo_get_oid_mb(struct repository *r, two = lookup_commit_reference_gently(r, &oid_tmp, 0); if (!two) return -1; - mbs = repo_get_merge_bases(r, one, two); + if (repo_get_merge_bases(r, one, two, &mbs) < 0) { + free_commit_list(mbs); + return -1; + } if (!mbs || mbs->next) st = -1; else { |
