Time preference: Fix a memory leak

Accidentally introduced with an earlier commit.
This commit is contained in:
Philippe Saint-Pierre 2012-01-02 16:52:52 -05:00
parent 93f68d97bf
commit 0106325bc4

View File

@ -175,8 +175,10 @@ Settings::SettingsChanged()
return true;
fOldMessage.Flatten(oldBytes, oldSize);
char* newBytes = new (std::nothrow) char[newSize];
if (newBytes == NULL)
if (newBytes == NULL) {
delete[] oldBytes;
return true;
}
fMessage.Flatten(newBytes, newSize);
int result = memcmp(oldBytes, newBytes, oldSize);