X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1582a1db62cf60d2a9b74b31e6778d46245a0f74..a4f6fe43c33bd7933645d110ad2719871dab043d:/include/wx/buffer.h diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 6d98f6e286..951777a13c 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -230,7 +230,8 @@ protected: static CharType *StrCopy(const CharType *src, size_t len) { CharType *dst = (CharType*)malloc(sizeof(CharType) * (len + 1)); - memcpy(dst, src, sizeof(CharType) * (len + 1)); + if ( dst ) + memcpy(dst, src, sizeof(CharType) * (len + 1)); return dst; }