preferences/sounds: Fix mismatching malloc/delete

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 <[email protected]>
This commit is contained in:
Murai Takashi
2019-09-21 16:11:10 +00:00
committed by Axel Dörfler
parent 04a1ee9750
commit 863eb82bca
+2 -2
View File
@@ -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;