mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-04 14:13:19 +00:00
Fix a few leaks
The interesting one is the notification macro, which was returning directly on a soft-abort instead of going through the cleanup.
This commit is contained in:
parent
d01737b419
commit
3e529e9d2d
12
src/stash.c
12
src/stash.c
@ -701,10 +701,14 @@ int git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int ver
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NOTIFY_PROGRESS(opts, progress_type) \
|
#define NOTIFY_PROGRESS(opts, progress_type) \
|
||||||
if ((opts).progress_cb && \
|
do { \
|
||||||
(error = (opts).progress_cb((progress_type), (opts).progress_payload))) \
|
if ((opts).progress_cb && \
|
||||||
return (error < 0) ? error : -1;
|
(error = (opts).progress_cb((progress_type), (opts).progress_payload))) { \
|
||||||
|
error = (error < 0) ? error : -1; \
|
||||||
|
goto cleanup; \
|
||||||
|
} \
|
||||||
|
} while(false);
|
||||||
|
|
||||||
int git_stash_apply(
|
int git_stash_apply(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
|
@ -44,6 +44,8 @@ void test_stash_apply__initialize(void)
|
|||||||
assert_status(repo, "how", GIT_STATUS_CURRENT);
|
assert_status(repo, "how", GIT_STATUS_CURRENT);
|
||||||
assert_status(repo, "who", GIT_STATUS_CURRENT);
|
assert_status(repo, "who", GIT_STATUS_CURRENT);
|
||||||
assert_status(repo, "when", GIT_ENOTFOUND);
|
assert_status(repo, "when", GIT_ENOTFOUND);
|
||||||
|
|
||||||
|
git_index_free(repo_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_stash_apply__cleanup(void)
|
void test_stash_apply__cleanup(void)
|
||||||
|
@ -257,4 +257,5 @@ void test_submodule_modify__save_last(void)
|
|||||||
|
|
||||||
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_gitmodules_only"));
|
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_gitmodules_only"));
|
||||||
cl_git_pass(git_submodule_save(sm));
|
cl_git_pass(git_submodule_save(sm));
|
||||||
|
git_submodule_free(sm);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user