Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
clean: release strbuf after use in remove_dirs()
author
Rene Scharfe
<l.s.r@web.de>
Wed, 30 Aug 2017 17:49:36 +0000
(19:49 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Sep 2017 23:49:27 +0000
(08:49 +0900)
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clean.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
861e655
)
diff --git
a/builtin/clean.c
b/builtin/clean.c
index 21a7a3299408ac507917ac13f9342e3148ac53ec..733b6d3745ee5780c697323372f1e78e28b8a117 100644
(file)
--- 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;
}