diff --git a/src/cas/generic/caServerI.cc b/src/cas/generic/caServerI.cc index 3e07e7b8a..76af364a5 100644 --- a/src/cas/generic/caServerI.cc +++ b/src/cas/generic/caServerI.cc @@ -121,12 +121,17 @@ void serverToolDebugFunc (const char *pFile, unsigned line, const char *pComment caStatus caServerI::attachInterface ( const caNetAddr & addrIn, bool autoBeaconAddr, bool addConfigBeaconAddr) { - casIntfOS * pIntf = new casIntfOS ( *this, this->clientBufMemMgr, - addrIn, autoBeaconAddr, addConfigBeaconAddr ); - - { - epicsGuard < epicsMutex > locker ( this->mutex ); - this->intfList.add ( *pIntf ); + try { + casIntfOS * pIntf = new casIntfOS ( *this, this->clientBufMemMgr, + addrIn, autoBeaconAddr, addConfigBeaconAddr ); + + { + epicsGuard < epicsMutex > locker ( this->mutex ); + this->intfList.add ( *pIntf ); + } + } + catch ( ... ) { + return S_cas_bindFail; } return S_cas_success;