Fix memory leak

This commit is contained in:
Marko Zivanovic
2015-09-06 00:45:02 +02:00
parent c9eefc79f1
commit 5363ab9460
+3 -2
View File
@@ -43,8 +43,9 @@ UDPWriter::UDPWriter(const std::string& destination, const int port) {
void UDPWriter::sendMessage(std::shared_ptr<const SyslogMessage> message) {
if (_socket.is_open()) {
auto formatted = RFC3164FormattedSyslogMessage{*message};
auto buff = buffer(formatted());
auto fmtMsg = RFC3164FormattedSyslogMessage{*message};
auto fmtStr = fmtMsg();
auto buff = buffer(fmtStr);
_socket.send(buff);
}
}