While calling RemoveAcceptedPorts(), the server has crashed.
Because the instance argument is deleted at the for loop.
This patch changes the parameter type to std::string.
Change-Id: Ib7754d128df647b75643baf34d4eca3e62264fd1
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
return port_name_;
}
-void Stub::RemoveAcceptedPorts(const std::string& instance) {
+void Stub::RemoveAcceptedPorts(std::string instance) {
std::lock_guard<std::recursive_mutex> lock(GetMutex());
auto iter = ports_.begin();
while (iter != ports_.end()) {
private:
void AddAcceptedPort(const std::string& sender_appid,
const std::string& instance, const std::string& port_type, int fd);
- void RemoveAcceptedPorts(const std::string& instance);
+ void RemoveAcceptedPorts(std::string instance);
std::recursive_mutex& GetMutex() const;
int GetFdFromSystemd();
int CreateServerSocket();