Commit 6d4a811c authored by Louis. Lenders's avatar Louis. Lenders Committed by Alexandre Julliard

msvcrt: Fix a crash in _strdup.

parent a1910e11
...@@ -50,9 +50,13 @@ char* msvcrt_strndup(const char* buf, unsigned int size) ...@@ -50,9 +50,13 @@ char* msvcrt_strndup(const char* buf, unsigned int size)
*/ */
char* CDECL _strdup(const char* str) char* CDECL _strdup(const char* str)
{ {
char * ret = MSVCRT_malloc(strlen(str)+1); if(str)
if (ret) strcpy( ret, str ); {
return ret; char * ret = MSVCRT_malloc(strlen(str)+1);
if (ret) strcpy( ret, str );
return ret;
}
else return 0;
} }
/********************************************************************* /*********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment