strbuf: accept NULL for strbuf_cleanup()

This commit is contained in:
Yu Watanabe 2018-08-22 21:50:50 +09:00
parent 3d05193e67
commit f73fc95ea5

View file

@ -66,6 +66,9 @@ void strbuf_complete(struct strbuf *str) {
/* clean up everything */
void strbuf_cleanup(struct strbuf *str) {
if (!str)
return;
strbuf_complete(str);
free(str->buf);
free(str);