diff options
Diffstat (limited to 'tools/perf/util/strbuf.c')
| -rw-r--r-- | tools/perf/util/strbuf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index 92e068517c1..4abe23550c7 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c @@ -1,4 +1,5 @@ #include "cache.h" +#include <linux/kernel.h> int prefixcmp(const char *str, const char *prefix) { @@ -27,7 +28,7 @@ void strbuf_init(struct strbuf *sb, ssize_t hint) void strbuf_release(struct strbuf *sb) { if (sb->alloc) { - free(sb->buf); + zfree(&sb->buf); strbuf_init(sb, 0); } } @@ -99,7 +100,7 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...) len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); va_end(ap); if (len > strbuf_avail(sb)) { - die("this should not happen, your snprintf is broken"); + die("this should not happen, your vsnprintf is broken"); } } strbuf_setlen(sb, sb->len + len); |
