diff options
author | nyamatongwe <devnull@localhost> | 2002-11-19 11:31:46 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2002-11-19 11:31:46 +0000 |
commit | d02d951237ebdb5d00595e93c68e24c78add2c13 (patch) | |
tree | 6db08ded0bd18edb1495820afbc12ab57b8887ef /src | |
parent | 3d2a8e49e572eacac9e0382584ca489b141bffbc (diff) | |
download | scintilla-mirror-d02d951237ebdb5d00595e93c68e24c78add2c13.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); } |