We allocate the strbuf at the beginning of the function, but do several
return checks after this which does not free the strbuf before return,
and we don't use the strbuf.
So create the strbuf object after checks, just before we need it.
Fixes CID 1039287