diff --git a/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp b/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp index 6dca15bf8aefd512b923e90cfc3b97f6034b7e64..562fdce5c4295927e39dc50dd26e3cdff40e83e9 100644 --- a/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp +++ b/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp @@ -32,6 +32,7 @@ #include "AccessBridgePackages.h" // for debugging only #include #include +#include DEBUG_CODE(extern HWND theDialogWindow); extern "C" { @@ -46,6 +47,9 @@ AccessBridgeQueueElement::AccessBridgeQueueElement(char *buf, int size) { next = (AccessBridgeQueueElement *) 0; previous = (AccessBridgeQueueElement *) 0; buffer = (char *) malloc(bufsize); + if (buffer == NULL) { + throw std::bad_alloc(); + } memcpy(buffer, buf, bufsize); }