Time preference: Fix a memory leak
Accidentally introduced with an earlier commit.
This commit is contained in:
@@ -175,8 +175,10 @@ Settings::SettingsChanged()
|
|||||||
return true;
|
return true;
|
||||||
fOldMessage.Flatten(oldBytes, oldSize);
|
fOldMessage.Flatten(oldBytes, oldSize);
|
||||||
char* newBytes = new (std::nothrow) char[newSize];
|
char* newBytes = new (std::nothrow) char[newSize];
|
||||||
if (newBytes == NULL)
|
if (newBytes == NULL) {
|
||||||
|
delete[] oldBytes;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
fMessage.Flatten(newBytes, newSize);
|
fMessage.Flatten(newBytes, newSize);
|
||||||
|
|
||||||
int result = memcmp(oldBytes, newBytes, oldSize);
|
int result = memcmp(oldBytes, newBytes, oldSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user