This looks fine, but would you mind making the same change on line 337?
Actually, perhaps I hit sent too early. If this memory allocation fails, which is the only situation under which add_oid_to_usage doesn't just return its first parameter, it'll immediately crash on the next invocation with a NULL pointer dereference.
I'm not sure it's worth all the trouble in an out of memory situation. Perhaps just remove the return value and let the caller crash.