Status: New
Labels: Type-Defect Priority-Medium

New issue 675 by memory leak

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\ (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\ (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:

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to