From cd015482d5f2ddb362b66391848f4d39753375d6 Mon Sep 17 00:00:00 2001 From: Svyatoslav Date: Fri, 5 May 2017 03:34:34 +0300 Subject: [PATCH] PVS-Studio: An exception should be caught by reference rather than by value. (#6003) --- src/lib/client/Client.cpp | 2 +- src/lib/server/Server.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index b37aa558..c744ec2b 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -820,7 +820,7 @@ Client::sendFileThread(void* filename) char* name = static_cast(filename); StreamChunker::sendFile(name, m_events, this); } - catch (std::runtime_error error) { + catch (std::runtime_error& error) { LOG((CLOG_ERR "failed sending file chunks: %s", error.what())); } diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 509467fc..206b145c 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -2392,7 +2392,7 @@ Server::sendFileThread(void* data) LOG((CLOG_DEBUG "sending file to client, filename=%s", filename)); StreamChunker::sendFile(filename, m_events, this); } - catch (std::runtime_error error) { + catch (std::runtime_error &error) { LOG((CLOG_ERR "failed sending file chunks, error: %s", error.what())); }