diff options
author | nyamatongwe <unknown> | 2002-11-19 11:31:46 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-11-19 11:31:46 +0000 |
commit | 9e45b0e7d3d6b025322a661448b7cb52c5106bc3 (patch) | |
tree | 6db08ded0bd18edb1495820afbc12ab57b8887ef /src | |
parent | db7f4e9d9e530925b0d9f1ec24c8f0ce543613c4 (diff) | |
download | scintilla-mirror-9e45b0e7d3d6b025322a661448b7cb52c5106bc3.tar.gz |
Protect against null pointer dereference when out of memory.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 2af278b19..1126b27ff 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5764,7 +5764,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_CREATEDOCUMENT: { Document *doc = new Document(); - doc->AddRef(); + if (doc) { + doc->AddRef(); + } return reinterpret_cast<sptr_t>(doc); } |