Well, re-reading this code, calling giterr_set_oom() doesn't make sense here, because the buffer is already allocated.