Or move just the validation code there:  

    if(valid_resource_or_tag(data_set, id_rh, &rsc_rh, &tag_rh) == FALSE) { ... }