aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2002-11-19 11:31:46 +0000
committernyamatongwe <devnull@localhost>2002-11-19 11:31:46 +0000
commitd02d951237ebdb5d00595e93c68e24c78add2c13 (patch)
tree6db08ded0bd18edb1495820afbc12ab57b8887ef
parent3d2a8e49e572eacac9e0382584ca489b141bffbc (diff)
downloadscintilla-mirror-d02d951237ebdb5d00595e93c68e24c78add2c13.tar.gz
Protect against null pointer dereference when out of memory.
-rw-r--r--src/Editor.cxx4
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);
}