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

@ -306,11 +306,15 @@ int parse_file(const char *filename, struct dive_table *table, struct trip_table
* Opening the cloud storage repository failed for some reason
* give up here and don't send errors about git repositories
*/
if (info.is_subsurface_cloud)
if (info.is_subsurface_cloud) {
cleanup_git_info(&info);
return -1;
}
}
return git_load_dives(&info, table, trips, sites, devices, filter_presets);
ret = git_load_dives(&info, table, trips, sites, devices, filter_presets);
cleanup_git_info(&info);
return ret;
}
if ((ret = readfile(filename, &mem)) < 0) {