Source code is if ( ::ioctl(fd, JSIOCGCORR, oldCorr) == -1 ) { ::close(fd); delete [] oldCorr; return JoyDevice::ERR_GET_CORR; } if (bt < 0) { return JoyDevice::ERR_GET_BUTTONS; } Suggest add close and delete on second if statement.
Thanks for finding this bug! Please feel free to submit a patch on https://phabricator.kde.org/
Thanks for the offer, but I leave fixing bugs to the folks who know the code.
If seems like you do know the code! :) Or at least well enough to contribute. I'm rubbish at C++ but my paltry skill level seems to be good enough so far. The worst thing that can happen is that you'll get a request for changes, and you'll learn something. Try it, you'll like it! This is a super welcoming community.
If that really is the code, just swap the two ifs() round
Thanks for the report, is this memory leak still occurring or has the issue been fixed? I've set this bug to NEEDSINFO. When you reply, please change the bug back to REPORTED so we know it's ready for investigation or RESOLVED/WORKSFORME if the issue is now resolved.
(In reply to Justin Zobel from comment #5) > Thanks for the report, is this memory leak still occurring or has the issue > been fixed? I have no idea and no plans to find out. Submitting bug reports that get ignored for more than three years looks pointless. I'll be directing my bug finding efforts elsewhere in future. You are on your own with this one.
We were all waiting on you, since you got the go-ahead to make the change. Open source is collaborative, with participation encouraged.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/381
Git commit 8a7afcb736cf857425938223f66bc84d5533f6b7 by Nate Graham. Committed on 12/03/2021 at 20:11. Pushed by cblack into branch 'master'. [kcms/joystick] Fix minor leak fd and oldcorr were not cleaned up before returning. FIXED-IN: 5.21.3 M +2 -0 kcms/joystick/joydevice.cpp https://invent.kde.org/plasma/plasma-desktop/commit/8a7afcb736cf857425938223f66bc84d5533f6b7
Git commit 1913d9f5b4700c349ff0460ec0390673aac76f31 by Jan Blackquill, on behalf of Nate Graham. Committed on 12/03/2021 at 20:30. Pushed by cblack into branch 'Plasma/5.21'. [kcms/joystick] Fix minor leak fd and oldcorr were not cleaned up before returning. FIXED-IN: 5.21.3 (cherry picked from commit 8a7afcb736cf857425938223f66bc84d5533f6b7) M +2 -0 kcms/hardware/joystick/joydevice.cpp https://invent.kde.org/plasma/plasma-desktop/commit/1913d9f5b4700c349ff0460ec0390673aac76f31
> We were all waiting on you, since you got the go-ahead to make > the change. Open source is collaborative, with participation > encouraged. It turns out that factually, what he got was more of a "go ahead, or else (the bug won't be fixed for another few years)", rather than a sincere go-ahead. And here's the thing: if you are the author/maintainer, gitwork is essentially YOUR JOB, and there is NO JUSTIFICATION for demanding that the user who did 100% of debugging also do the gitwork. There is NO JUSTIFICATION for not applying an obvious known fix FOR YEARS just because you want to make the point about "encouraging participation". A community that does that is not a "super welcoming" community, it is a "we can't be bothered to spend 5 minutes to formally wrap up a 2-LOC, single file result of what could have been hours or days of somebody else's debugging work" community. "Collaborative"? "I spend hours debugging, you spend 5 minutes to push my result through the right channels" is fair collaboration. "I spend hours debugging, you spend 15 minutes tutoring me interactively about the knowables and the unknowables of this project's submission process a.k.a. teach the man to fish" would also be fair collaboration. But "I spend hours debugging and you ask me to spend further hours (possibly spread over days) pushing the result through a territory unknown to me" is not fair collaboration.
OK, sorry you didn't have a good experience.