From: Stefan Csomor Date: Fri, 11 Jul 2003 20:16:05 +0000 (+0000) Subject: out of memory for strdup handled X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d314acc0ba326a92cfaf387d68bf9957e5b8891b out of memory for strdup handled git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 571d165d3d..eaa2b5b4e7 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -1387,7 +1387,10 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt #if __MSL__ < 0x00008000 char *strdup(const char *s) { - return strcpy( (char*) malloc( strlen( s ) + 1 ) , s ) ; + char *dest = (char*) malloc( strlen( s ) + 1 ) ; + if ( dest ) + strcpy( dest , s ) ; + return dest ; } #endif int isascii( int c )