If strbuf is over 5MB, or the realloc() fails, clear strbuf and break before writing to strbuf. Found by scan-build