Skip to content

Commit

Permalink
fix memory leaks in DBusInputStream
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten-klein committed Mar 24, 2020
1 parent 9f85f0f commit 3f163cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/CommonAPI/DBus/DBusInputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string>
#include <vector>
#include <cstring>
#include <memory>

#include <CommonAPI/Export.hpp>
#include <CommonAPI/InputStream.hpp>
Expand Down Expand Up @@ -518,7 +519,7 @@ class DBusInputStream
char *begin_;
size_t current_;
size_t size_;
CommonAPI::DBus::DBusError* exception_;
std::unique_ptr<CommonAPI::DBus::DBusError> exception_;
CommonAPI::DBus::DBusMessage message_;

std::vector<uint32_t> sizes_;
Expand Down
2 changes: 1 addition & 1 deletion src/CommonAPI/DBus/DBusInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ char *DBusInputStream::_readRaw(const size_t _size) {
}

void DBusInputStream::setError() {
exception_ = new CommonAPI::DBus::DBusError();
exception_ = std::unique_ptr<CommonAPI::DBus::DBusError>(new CommonAPI::DBus::DBusError());
}

void DBusInputStream::pushPosition() {
Expand Down

0 comments on commit 3f163cb

Please sign in to comment.