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>
This commit is contained in:
Rene Scharfe 2017-08-30 19:49:36 +02:00 committed by Junio C Hamano
parent 861e65557f
commit 25a8f80a84

View file

@ -167,7 +167,7 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
} }
*dir_gone = 0; *dir_gone = 0;
return 0; goto out;
} }
dir = opendir(path->buf); 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); warning_errno(_(msg_warn_remove_failed), quoted.buf);
*dir_gone = 0; *dir_gone = 0;
} }
return res; ret = res;
goto out;
} }
strbuf_complete(path, '/'); 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++) for (i = 0; i < dels.nr; i++)
printf(dry_run ? _(msg_would_remove) : _(msg_remove), dels.items[i].string); printf(dry_run ? _(msg_would_remove) : _(msg_remove), dels.items[i].string);
} }
out:
strbuf_release(&quoted);
string_list_clear(&dels, 0); string_list_clear(&dels, 0);
return ret; return ret;
} }