tempurl = nsCRT::strdup(temp);
tempurl = strdup(temp);
nsresult testURL(const char* i_pURL, PRInt32 urlFactory = URL_FACTORY_DEFAULT){    if (i_pURL)        return writeout(i_pURL, urlFactory);    if (!gFileIO)        return NS_ERROR_FAILURE;    FILE *testfile = fopen(gFileIO, "rt");    if (!testfile)     {        fprintf(stderr, "Cannot open testfile: %s\n", gFileIO);        return NS_ERROR_FAILURE;    }    char temp[512];    int count=0;    int failed=0;    char* prevResult = nsnull;    char* tempurl = nsnull;    while (fgets(temp,512,testfile))    {        if (*temp == '#' || !*temp)            continue;        if (0 == count%3)        {            if (prevResult) delete[] prevResult;            printf("Testing:  %s\n", temp);            writeoutto(temp, &prevResult, urlFactory);        }        else if (1 == count%3) {            if (tempurl) delete[] tempurl;            tempurl = nsCRT::strdup(temp);        } else {             if (!prevResult)                printf("no results to compare to!\n");            else             {                PRInt32 res;                printf("Result:   %s\n", prevResult);                if (urlFactory != URL_FACTORY_DEFAULT) {                    printf("Expected: %s\n", tempurl);                    res = PL_strcmp(tempurl, prevResult);                } else {                    printf("Expected: %s\n", temp);                    res = PL_strcmp(temp, prevResult);                }                if (res == 0)                    printf("\tPASSED\n\n");                else                 {                    printf("\tFAILED\n\n");                    failed++;                }            }        }        count++;    }    if (failed>0) {        printf("%d tests FAILED out of %d\n", failed, count/3);        return NS_ERROR_FAILURE;    } else {        printf("All %d tests PASSED.\n", count/3);        return NS_OK;    }}