diff options
author | Rene Scharfe <l.s.r@web.de> | 2017-08-30 19:49:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-07 08:49:27 +0900 |
commit | 25a8f80a8482d74225587fb2f667a8f296a58c48 (patch) | |
tree | 75e5ac034208efa48a29ef8c499e2584a06e9b33 /builtin/clean.c | |
parent | 861e65557f14a0d93af780c71d82f194404dd563 (diff) | |
download | git-25a8f80a8482d74225587fb2f667a8f296a58c48.tar.gz |
clean: release strbuf after use in remove_dirs()
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clean.c')
-rw-r--r-- | builtin/clean.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/clean.c b/builtin/clean.c index 21a7a32994..733b6d3745 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -167,7 +167,7 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, } *dir_gone = 0; - return 0; + goto out; } dir = opendir(path->buf); @@ -181,7 +181,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, warning_errno(_(msg_warn_remove_failed), quoted.buf); *dir_gone = 0; } - return res; + ret = res; + goto out; } strbuf_complete(path, '/'); @@ -249,6 +250,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, for (i = 0; i < dels.nr; i++) printf(dry_run ? _(msg_would_remove) : _(msg_remove), dels.items[i].string); } +out: + strbuf_release("ed); string_list_clear(&dels, 0); return ret; } |