bug: Fix Face::put warning
Change-Id: I5918fac25025510fb48f5e5e256d20f597782962
diff --git a/src/chat-dialog.cpp b/src/chat-dialog.cpp
index 93d7dd0..334f345 100644
--- a/src/chat-dialog.cpp
+++ b/src/chat-dialog.cpp
@@ -544,11 +544,11 @@
OBufferStream os;
msg.SerializeToOstream(&os);
- Data data(interest.getName());
- data.setContent(os.buf());
- m_keyChain.sign(data, m_myCertificate.getName());
+ shared_ptr<Data> data = make_shared<Data>(interest.getName());
+ data->setContent(os.buf());
+ m_keyChain.sign(*data, m_myCertificate.getName());
- m_face->put(data);
+ m_face->put(*data);
}
void
@@ -563,10 +563,11 @@
try {
Name certName = interest.getName().getSubName(prefix.size());
const Sync::IntroCertificate& introCert = m_sock->getIntroCertificate(certName);
- Data data(interest.getName());
- data.setContent(introCert.wireEncode());
- m_keyChain.sign(data, m_myCertificate.getName());
- m_face->put(data);
+
+ shared_ptr<Data> data = make_shared<Data>(interest.getName());
+ data->setContent(introCert.wireEncode());
+ m_keyChain.sign(*data, m_myCertificate.getName());
+ m_face->put(*data);
}
catch(Sync::SyncSocket::Error& e) {
return;