Ensure that odb is always freed
Handle errors while building the list gracefully
Don't leave dangling references to oid strings