Skip to content

Commit

Permalink
[dbus] fix using dbusError after free (#592)
Browse files Browse the repository at this point in the history
dbusError is freed before used in logging. This caused wrong logging message.
  • Loading branch information
simonlingoogle authored Oct 19, 2020
1 parent 36d370a commit 6f0c803
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dbus/server/dbus_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ otbrError DBusAgent::Init(void)
mThreadObject = std::unique_ptr<DBusThreadObject>(new DBusThreadObject(mConnection.get(), mInterfaceName, mNcp));
error = mThreadObject->Init();
exit:
dbus_error_free(&dbusError);
if (error != OTBR_ERROR_NONE)
{
otbrLog(OTBR_LOG_ERR, "dbus error %s: %s", dbusError.name, dbusError.message);
}
dbus_error_free(&dbusError);
return error;
}

Expand Down

0 comments on commit 6f0c803

Please sign in to comment.