Skip to content

Commit 72bca80

Browse files
SiegeLordExSiegeLord
authored andcommitted
Use al_malloc/al_free.
1 parent e62be5f commit 72bca80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/macosx/hidjoy.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
CONFIG_STATE cfg_state;
6464
ALLEGRO_JOYSTICK_STATE state;
6565
IOHIDDeviceRef ident;
66-
char * name;
66+
char *name;
6767
} ALLEGRO_JOYSTICK_OSX;
6868

6969
static IOHIDManagerRef hidManagerRef;
@@ -768,9 +768,9 @@ static bool reconfigure_joysticks(void)
768768
CFIndex length = CFStringGetLength(str);
769769
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1;
770770
if (joy->name) {
771-
free(joy->name);
771+
al_free(joy->name);
772772
}
773-
joy->name = (char *)malloc(maxSize);
773+
joy->name = (char *)al_malloc(maxSize);
774774
if (joy->name) {
775775
if (CFStringGetCString(str, joy->name, maxSize, kCFStringEncodingUTF8)) {
776776
return joy->name;

0 commit comments

Comments
 (0)