mem error handling for AddGraphEdge()