From 3e529e9d2dd2ae90d43612b9906f16c812101033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 13 May 2015 16:12:45 +0200 Subject: 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. --- src/stash.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/stash.c b/src/stash.c index c79068edf..0c5cd1d2a 100644 --- a/src/stash.c +++ b/src/stash.c @@ -701,10 +701,14 @@ int git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int ver return 0; } -#define NOTIFY_PROGRESS(opts, progress_type) \ - if ((opts).progress_cb && \ - (error = (opts).progress_cb((progress_type), (opts).progress_payload))) \ - return (error < 0) ? error : -1; +#define NOTIFY_PROGRESS(opts, progress_type) \ + do { \ + if ((opts).progress_cb && \ + (error = (opts).progress_cb((progress_type), (opts).progress_payload))) { \ + error = (error < 0) ? error : -1; \ + goto cleanup; \ + } \ + } while(false); int git_stash_apply( git_repository *repo, -- cgit v1.2.1