Fixing a mem leak in test code

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@975 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ivan.penkov@gmail.com 2012-06-29 22:34:04 +00:00
parent 6de969a304
commit 1a7a0a4d4b
4 changed files with 26 additions and 9 deletions

View file

@ -94,9 +94,7 @@ class StackwalkerARMFixture {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
void SetModuleSymbols(MockCodeModule *module, const string &info) {
unsigned int buffer_size = info.size() + 1;
char *buffer = reinterpret_cast<char*>(operator new(buffer_size));
strcpy(buffer, info.c_str());
char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info);
EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _))
.WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
Return(MockSymbolSupplier::FOUND)));