Skip to content

Commit

Permalink
Fix a CFStringRef leak in RTMidi Port Name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
baconpaul committed Mar 20, 2024
1 parent 1e5b499 commit 910c01a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ CFStringRef CreateEndpointName( MIDIEndpointRef endpoint, bool isExternal )
CFStringInsert( result, 0, CFSTR(" ") );

CFStringInsert( result, 0, str );
CFRelease(str);
}
}
}
Expand Down

0 comments on commit 910c01a

Please sign in to comment.