From 910c01a091b777940f342a3bc4ed1bcd45c8e122 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 20 Mar 2024 18:29:45 -0400 Subject: [PATCH] Fix a CFStringRef leak in RTMidi Port Name In certain circumstances when building a compound port name (for instance, with an IAC bus), the string math to concatenate the bus and driver does not release one of the source strings, causing a CFStringRef leak on macOS. This fixes it by doing the appropriate CFRelease after string concatenation. --- RtMidi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/RtMidi.cpp b/RtMidi.cpp index 0c3dcbe..3e91487 100644 --- a/RtMidi.cpp +++ b/RtMidi.cpp @@ -1376,6 +1376,7 @@ CFStringRef CreateEndpointName( MIDIEndpointRef endpoint, bool isExternal ) CFStringInsert( result, 0, CFSTR(" ") ); CFStringInsert( result, 0, str ); + CFRelease(str); } } }