X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fwrbuf.c;h=31729b031c11fc362b04a686d0acd6a9c7123518;hb=4437d37d1844243b154c4323413e18c50e3b8779;hp=0af358263abeb138dcfb30fe0bd1425e4dc02e2a;hpb=88d3bedf772316f87e1996f655ccf8d1e2589755;p=yaz-moved-to-github.git diff --git a/src/wrbuf.c b/src/wrbuf.c index 0af3582..31729b0 100644 --- a/src/wrbuf.c +++ b/src/wrbuf.c @@ -35,8 +35,11 @@ WRBUF wrbuf_alloc(void) void wrbuf_destroy(WRBUF b) { - xfree(b->buf); - xfree(b); + if (b) + { + xfree(b->buf); + xfree(b); + } } void wrbuf_rewind(WRBUF b) @@ -76,11 +79,6 @@ void wrbuf_puts(WRBUF b, const char *buf) wrbuf_write(b, buf, strlen(buf)); } -void wrbuf_vputs(const char *buf, void *client_data) -{ - wrbuf_write((WRBUF) client_data, buf, strlen(buf)); -} - void wrbuf_puts_replace_char(WRBUF b, const char *buf, const char from, const char to) {