You can reduce it to two lines:

    if (getenv(GST_USE_DLNA_PROTOCOL_ENV_VAR))
        cleanUrl.insert("dlna+", 0);