Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 479 by [email protected]: Deallocating an proto class(with a string) in C++ gives a heap error when "delete stringvariable" is called
http://code.google.com/p/protobuf/issues/detail?id=479

What steps will reproduce the problem?
1.I have proto file that generates a class with some classes and string in it . 2.I instantiate an object of that class put in some fields and then use serialize it:
{       int sizeArr = request->ByteSize();
        char* aux = (char*)malloc(sizeArr);
        request->SerializeToArray((void*)aux,sizeArr);
}
3.After this i declare another object in a scope so that the destructor could be called,and parsed the serialized array of the first class in which i set some values :
{MsgWebRequest webReqTest;
                webReqTest.ParseFromArray(aux,sizeArr);
}

What is the expected output? What do you see instead?

The expected output should be that the second object should deallocate successfully, but it doesn't, it gives me a corrupt heap , and breaks at dbgheap.c(in the call stack the last class that is called from the protobuffer is delete variable(where variable is a string type, that i seted before)).
What version of the product are you using? On what operating system?
Windows vista 64, protocol buffers 2.4.1

Please provide any additional information below.


--
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

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to