X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f2c6e607622d2f8c684b2a6417bd43f52e3b9eef..3678169caab0f713415414dce013a638305f3cce:/include/wx/buffer.h diff --git a/include/wx/buffer.h b/include/wx/buffer.h index ec0e1fc765..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; } @@ -438,7 +439,7 @@ public: friend class wxMemoryBuffer; - // everyting is private as it can only be used by wxMemoryBuffer + // everything is private as it can only be used by wxMemoryBuffer private: wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize) : m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0)