Memory leak in MacOS joystick code
Closed this issue · 6 comments
pedro-w commented
The static analyzer tells me there's a leak here:
Lines 363 to 375 in edcc50e
device_arr
is calloc'd and never freed.Probably not a big deal as it's called only once by
init_joystick
ReiquelApplegate commented
what static analyzer did you use?
pedro-w commented
The one in Xcode but I believe it's based on the same technology as the clang static analyzer (scan-build
or whatever)
pedro-w commented
@ReiquelApplegate do you think it's wrong?
ReiquelApplegate commented
No, I agree free(device_arr)
should be called.
pedro-w commented
Trivial really but I'll do a PR for this.
@SiegeLord should we be using al_calloc
for internal memory allocation?
SiegeLord commented
Vs a plain calloc
, yes, most of the time.