fix possible 0 bytes allocation