Issue 675 in protobuf: memory leak

330 views
Skip to first unread message

prot...@googlecode.com

unread,
Oct 19, 2014, 9:55:00 PM10/19/14
to prot...@googlegroups.com
Status: New
Owner: liu...@google.com
Labels: Type-Defect Priority-Medium

New issue 675 by vxm...@gmail.com: memory leak
https://code.google.com/p/protobuf/issues/detail?id=675

A memory leak is detected by vld(visual leak detector).
I think the problem is caused by this function:
void InitEmptyString() {
empty_string_ = new string;
}
empty_string_ will not be deleted later.

In previous version protobuf-2.5.0, empty string is a global std::string
const ::std::string kEmptyString;




protobuf version: protobuf-2.6.0
OS: windows 8.1
build env: visual studio 2013

Some output generated by vld:
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.cc
(55):
ChatServerd.exe!google::protobuf::internal::InitEmptyString + 0x7
bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\common.h (876):
ChatServerd.exe!google::protobuf::internal::FunctionClosure0::Run + 0xA
bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.cc (83):
ChatServerd.exe!google::protobuf::GoogleOnceInitImpl + 0xF bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.h (127):
ChatServerd.exe!google::protobuf::GoogleOnceInit + 0xD bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.h
(84): ChatServerd.exe!google::protobuf::internal::GetEmptyString + 0xF bytes

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

prot...@googlecode.com

unread,
Oct 20, 2014, 1:46:39 PM10/20/14
to prot...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages