git access: add proper cleanup function for git_info

We had various random "free parts of the git info" left-overs from when
we passed down the git repo data ad-hoc.  Get rid of it, and replace it
with just doing a 'cleanup_git_info()' that does the final cleanup of it
all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2022-04-18 14:36:00 -07:00 committed by Dirk Hohndel
parent 96337dbbcf
commit e33680c336
9 changed files with 28 additions and 15 deletions

View file

@ -1960,8 +1960,6 @@ int git_load_dives(struct git_info *info, struct dive_table *table, struct trip_
if (!info->repo)
return report_error("Unable to open git repository '%s[%s]'", info->url, info->branch);
ret = do_git_load(info->repo, info->branch, &state);
git_repository_free(info->repo);
free((void *)info->branch);
finish_active_dive(&state);
finish_active_trip(&state);
return ret;