Skip to content
Snippets Groups Projects
Commit c74e5b28 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

fix memleak

parent 9bb8ceef
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ Error Request::ReceiveMetaData() {
if (err) {
return err;
}
metadata_.assign((char*)buf.get());
metadata_.assign((char*)buf.get(),request_header_.meta_size);
return nullptr;
}
......
......@@ -104,8 +104,8 @@ class RequestTests : public Test {
};
ACTION_P(CopyStr,value) {
if (value.size()<=arg2) {
strcpy(static_cast<char*>(arg1), value.c_str());
if (value.size()<=arg2 && value.size()>0) {
memcpy(static_cast<char*>(arg1), value.c_str(),value.size());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment