#6716 Changed throw to pass exception to caller and handle it there updated debug message
This commit is contained in:
parent
59e63f5818
commit
bdd36c389d
1 changed files with 5 additions and 2 deletions
|
|
@ -61,6 +61,9 @@ ProtocolUtil::readf(synergy::IStream* stream, const char* fmt, ...)
|
||||||
catch (XIO&) {
|
catch (XIO&) {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
catch (std::bad_alloc & exception) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -222,8 +225,8 @@ ProtocolUtil::vreadf(synergy::IStream* stream, const char* fmt, va_list args)
|
||||||
catch (std::bad_alloc & exception) {
|
catch (std::bad_alloc & exception) {
|
||||||
// Added try catch due to GHSA-chfm-333q-gfpp
|
// Added try catch due to GHSA-chfm-333q-gfpp
|
||||||
LOG((CLOG_ERR "ALLOC: Unable to allocate memory %d bytes", len));
|
LOG((CLOG_ERR "ALLOC: Unable to allocate memory %d bytes", len));
|
||||||
LOG((CLOG_DEBUG "bad_alloc detected: %s", exception.what()));
|
LOG((CLOG_DEBUG "bad_alloc detected: Do you have enough free memory?"));
|
||||||
throw;
|
throw exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue