[Scummvm-git-logs] scummvm master -> 03cf6531a55000b0789c93d84ebfc6994eae55dd

criezy criezy at scummvm.org
Mon Apr 27 22:28:34 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c421a25b8e GRAPHICS: Fix mismatching malloc/delete[]
03cf6531a5 AUDIO: Fix mismatching malloc/delete[]


Commit: c421a25b8e2f2c3e1abe90c3f382e76557180715
    https://github.com/scummvm/scummvm/commit/c421a25b8e2f2c3e1abe90c3f382e76557180715
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-04-27T23:06:15+01:00

Commit Message:
GRAPHICS: Fix mismatching malloc/delete[]

Changed paths:
    graphics/fonts/bdf.cpp


diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index aa8d69fd4a..12de9ee0ee 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -752,8 +752,12 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) {
 	data.firstCharacter = src->_data.firstCharacter;
 	data.defaultCharacter = src->_data.defaultCharacter;
 	data.numCharacters = src->_data.numCharacters;
-	data.familyName = scumm_strdup(src->_data.familyName);
-	data.slant = scumm_strdup(src->_data.slant);
+	char *familyName = new char[1 + strlen(src->_data.familyName)];
+	strcpy(familyName, src->_data.familyName);
+	data.familyName = familyName;
+	char *slant = new char[1 + strlen(src->_data.slant)];
+	strcpy(slant, src->_data.slant);
+	data.slant = slant;
 
 	BdfBoundingBox *boxes = new BdfBoundingBox[data.numCharacters];
 	for (int i = 0; i < data.numCharacters; ++i) {


Commit: 03cf6531a55000b0789c93d84ebfc6994eae55dd
    https://github.com/scummvm/scummvm/commit/03cf6531a55000b0789c93d84ebfc6994eae55dd
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-04-27T23:06:15+01:00

Commit Message:
AUDIO: Fix mismatching malloc/delete[]

Changed paths:
    audio/softsynth/fluidsynth.cpp


diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index c66243348d..c61983e6b9 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -100,14 +100,14 @@ void MidiDriver_FluidSynth::setInt(const char *name, int val) {
 	char *name2 = scumm_strdup(name);
 
 	fluid_settings_setint(_settings, name2, val);
-	delete[] name2;
+	free(name2);
 }
 
 void MidiDriver_FluidSynth::setNum(const char *name, double val) {
 	char *name2 = scumm_strdup(name);
 
 	fluid_settings_setnum(_settings, name2, val);
-	delete[] name2;
+	free(name2);
 }
 
 void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
@@ -115,8 +115,8 @@ void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
 	char *val2 = scumm_strdup(val);
 
 	fluid_settings_setstr(_settings, name2, val2);
-	delete[] name2;
-	delete[] val2;
+	free(name2);
+	free(val2);
 }
 
 int MidiDriver_FluidSynth::open() {




More information about the Scummvm-git-logs mailing list