From d02d951237ebdb5d00595e93c68e24c78add2c13 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 19 Nov 2002 11:31:46 +0000 Subject: Protect against null pointer dereference when out of memory. --- src/Editor.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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(doc); } -- cgit v1.2.3