shorten: pass on error value from allocate_buffers() instead of returning -1