]> git.saurik.com Git - wxWidgets.git/commitdiff
out of memory for strdup handled
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 11 Jul 2003 20:16:05 +0000 (20:16 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 11 Jul 2003 20:16:05 +0000 (20:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wxchar.cpp

index 571d165d3d6c3b0ad445d53f23c48cec9915e2ef..eaa2b5b4e71e3ab8f06b5b16d431abdd100daf5e 100644 (file)
@@ -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 )