I'm not sure we need a cleanup here if we're not freeing memory. If the function fails to resolve, we should make no guarantees regarding the status of the buffer, so I don't think the label is necessary here. Just return an error code.