From 96a13ed1219a9a9d1be2a9e573744f4b1dbe09e8 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Mon, 26 May 2003 18:07:29 +0000 Subject: [PATCH] added checking for memory allocation failure in MakeConfigurationView git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3344 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/stxttranslator/STXTTranslator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/add-ons/translators/stxttranslator/STXTTranslator.cpp b/src/add-ons/translators/stxttranslator/STXTTranslator.cpp index 34f898ff3d..e93bebb95a 100644 --- a/src/add-ons/translators/stxttranslator/STXTTranslator.cpp +++ b/src/add-ons/translators/stxttranslator/STXTTranslator.cpp @@ -947,7 +947,9 @@ STXTTranslator::Translate(BPositionIO *inSource, // // Postconditions: // -// Returns: +// Returns: B_BAD_VALUE if ioExtension or outView are NULL, +// B_NO_MEMORY if a view can't be allocated, +// B_OK if all goes well // --------------------------------------------------------------- status_t STXTTranslator::MakeConfigurationView(BMessage *ioExtension, BView **outView, @@ -958,6 +960,9 @@ STXTTranslator::MakeConfigurationView(BMessage *ioExtension, BView **outView, STXTView *view = new STXTView(BRect(0, 0, 225, 175), "STXTTranslator Settings", B_FOLLOW_ALL, B_WILL_DRAW); + if (!view) + return B_NO_MEMORY; + *outView = view; *outExtent = view->Bounds();