diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-10-05 22:06:06 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-10-05 22:06:06 +0200 |
| commit | fc575f6986d19205a3b97f1813246529c6d2fc79 (patch) | |
| tree | 73f14c6bae1306f9510f95579438d18fcaf01754 /buffer.c | |
| parent | e3c1f30e6d8dc15b35842d847f87954b4aa046e0 (diff) | |
| download | vis-fc575f6986d19205a3b97f1813246529c6d2fc79.tar.gz vis-fc575f6986d19205a3b97f1813246529c6d2fc79.tar.xz | |
Fix various issues reported by coverity scan
Diffstat (limited to 'buffer.c')
| -rw-r--r-- | buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -118,8 +118,10 @@ bool buffer_vprintf(Buffer *buf, const char *fmt, va_list ap) { va_list ap_save; va_copy(ap_save, ap); int len = vsnprintf(NULL, 0, fmt, ap); - if (len == -1 || !buffer_grow(buf, len+1)) + if (len == -1 || !buffer_grow(buf, len+1)) { + va_end(ap_save); return false; + } bool ret = vsnprintf(buf->data, len+1, fmt, ap_save) == len; if (ret) buf->len = len+1; |
