The first buf == NULL check is to help Coverity. The second is to defend against failing malloc.
The first buf == NULL check is to help Coverity.
The second is to defend against failing malloc.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb