char* newScheme = new char[length];
char* newScheme = (char *)PR_Malloc(length+1);
GetScheme(const char* inURI, char* *scheme){    // search for something up to a colon, and call it the scheme    char c;    const char* URI = inURI;    PRUint32 i = 0;    PRUint32 length = 0;    while ((c = *URI++) != '\0') {        if (c == ':') {            char* newScheme = new char[length];            if (newScheme == nsnull)                return NS_ERROR_OUT_OF_MEMORY;            nsCRT::memcpy(newScheme, inURI, length);            newScheme[length] = '\0';            *scheme = newScheme;            return NS_OK;        }        else if (isalpha(c)) {            length++;        }    }    return NS_ERROR_FAILURE;    // no colon}