Closed N-R-K closed 1 year ago
This PR is accumulating some unrelated commits as well. So I think I'll just mark this ready for review for now - the other two instances can be investigated and fixed in another PR.
@guijan A review would be useful.
(For some reason github won't let me use the "request review" feature to request a review from you).
Probably because I'm not a collaborator. Will have a look tomorrow.
Incredible how in master opt.exec
gets dup()
'd for no reason, then the imPrintf()
call in scrotExecapp()
dup()
s it again, and then both leak... Scrot is one of those code bases with about as many bugs as lines of code.
This touches some of the code I'm least familiar with, namely X programming, so I can't vouch for the PR, but it looks fine.
Rebased to solve conflict. Only other change is removing the assert
in scrotSelectionGetLineColor
.
There are many cases in scrot where strings are unnecessarily duplicated. The goal of this patchset is to remove these.
Most of these strings also were never free-ed, so this also technically fixes some memory leaks (although in practice this isn't that big of an issue since scrot is a "one shot" program, not a long running process).
A couple other cases worth investigating:
Also note:
opt.lineMode
is handled in #282.