nsCmdLineService::GetProgramName needs to copy the string to be compliant with the interface definition. Bug 249737, r+sr=jst.

git-svn-id: svn://10.0.0.236/trunk@158734 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com 2004-07-04 11:01:50 +00:00
parent 90236fac10
commit a0a82bdf9d
2 changed files with 4 additions and 12 deletions

View File

@ -222,12 +222,8 @@ nsCmdLineService::GetURLToLoad(char ** aResult)
NS_IMETHODIMP
nsCmdLineService::GetProgramName(char ** aResult)
{
nsresult rv = NS_OK;
*aResult = (char *)mArgValueList.SafeElementAt(0);
return rv;
*aResult = nsCRT::strdup((char *)mArgValueList.SafeElementAt(0));
return NS_OK;
}
PRBool nsCmdLineService::ArgsMatch(const char *lookingFor, const char *userGave)

View File

@ -222,12 +222,8 @@ nsCmdLineService::GetURLToLoad(char ** aResult)
NS_IMETHODIMP
nsCmdLineService::GetProgramName(char ** aResult)
{
nsresult rv = NS_OK;
*aResult = (char *)mArgValueList.SafeElementAt(0);
return rv;
*aResult = nsCRT::strdup((char *)mArgValueList.SafeElementAt(0));
return NS_OK;
}
PRBool nsCmdLineService::ArgsMatch(const char *lookingFor, const char *userGave)