commit - 991857c7d6b96717f24bc49df50e8aacf12b02cf
commit + e9e7947043acbb1cb2962a4d2361c95af3dfe3b4
blob - 293d3842bc39e809e4591897a7a0866c1a9f718f
blob + f69b2fc972e4829dd036416d66095d49c43ab0cb
--- got/got.c
+++ got/got.c
got_repo_pack_fds_close(pack_fds);
if (error == NULL)
error = pack_err;
+ }
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
}
if (preserve_logmsg) {
fprintf(stderr, "%s: log message preserved in %s\n",
got_ref_close(head_ref);
if (ref)
got_ref_close(ref);
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
+ }
got_pathlist_free(&paths, GOT_PATHLIST_FREE_NONE);
free(commit_id_str);
free(commit_id);
"'got checkout'.\n"
"The got(1) manual page contains more information.", cmdname);
err = got_error_msg(GOT_ERR_NOT_WORKTREE, msg);
- got_repo_close(repo);
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (close_err == NULL)
+ err = close_err;
+ }
if (pack_fds) {
const struct got_error *pack_err =
got_repo_pack_fds_close(pack_fds);
got_repo_pack_fds_close(pack_fds);
if (error == NULL)
error = pack_err;
+ }
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
}
free(worktree_path);
got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
if (error == NULL)
error = pack_err;
}
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
+ }
got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
free(cwd);