mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 23:11:47 +00:00
msvcrt: Fix a crash in _strdup.
This commit is contained in:
parent
a1910e11bb
commit
6d4a811cd5
|
@ -50,9 +50,13 @@ char* msvcrt_strndup(const char* buf, unsigned int size)
|
|||
*/
|
||||
char* CDECL _strdup(const char* str)
|
||||
{
|
||||
char * ret = MSVCRT_malloc(strlen(str)+1);
|
||||
if (ret) strcpy( ret, str );
|
||||
return ret;
|
||||
if(str)
|
||||
{
|
||||
char * ret = MSVCRT_malloc(strlen(str)+1);
|
||||
if (ret) strcpy( ret, str );
|
||||
return ret;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in a new issue