From 863eb82bcae34284e8c9e5db58925c90ceb479b4 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sat, 21 Sep 2019 16:06:50 +0900 Subject: [PATCH] preferences/sounds: Fix mismatching malloc/delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fType is allocated by strdup() in SetType(), buf freed by delete. Pointed out by LGTM. Change-Id: Id9e900863bf6921fd29f2c8abbd21da182f9055c Reviewed-on: https://review.haiku-os.org/c/haiku/+/1884 Reviewed-by: Axel Dörfler --- src/preferences/sounds/HEventList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preferences/sounds/HEventList.cpp b/src/preferences/sounds/HEventList.cpp index 5e7edd04f4..c3df32c163 100644 --- a/src/preferences/sounds/HEventList.cpp +++ b/src/preferences/sounds/HEventList.cpp @@ -70,7 +70,7 @@ HEventList::HEventList(const char* name) HEventList::~HEventList() { RemoveAll(); - delete fType; + free(fType); } @@ -80,7 +80,7 @@ HEventList::SetType(const char* type) RemoveAll(); BMediaFiles mfiles; mfiles.RewindRefs(type); - delete fType; + free(fType); fType = strdup(type); BString name;