OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
1.1k stars 195 forks source link

Users do not free results of cgiGetVariable #1052

Closed AreaZR closed 2 months ago

AreaZR commented 2 months ago

cgiGetVariable and friends return an strdup string, which is important when assigning after clearing the variables in the array. the problem is that this memory is just leaked.

michaelrsweet commented 2 months ago

This is not a problem because the CGI programs are short-lived and all process memory is freed on exit.

We chose this approach over an explicit memory pool or other mechanism to fix certain bugs.