Closed chandrakant2023 closed 7 months ago
You don't
free
CUPS arrays, youcupsArrayDelete
them...
in cupsArrayDelete "devices" not been free as this device only get allocated in cups_enum_dests(..) when there is
so, we may have to free it in cups_enum_dests(..) when there is any above condition is satisfied
Any thought ?
@chandrakant2023 If "devices" is not NULL
, then a cups_array_t
object has been allocated. I am OK with the goals of your PR, but you need to use the cupsArrayDelete
function to free the memory and not the free
function.
@chandrakant2023 If "devices" is not
NULL
, then acups_array_t
object has been allocated. I am OK with the goals of your PR, but you need to use thecupsArrayDelete
function to free the memory and not thefree
function.
Thank you for this, have used cupsArrayDelete() instead free() now for data.devices
Oh, and I just noticed this is a pull request against the wrong project - this might only apply to 2.4.x as 2.5 and 3.0 use a new CUPS DNS-SD API... Please re-file against the CUPS project.
Oh, and I just noticed this is a pull request against the wrong project - this might only apply to 2.4.x as 2.5 and 3.0 use a new CUPS DNS-SD API... Please re-file against the CUPS project.
Hi, I checked the project you mentioned, However the code base I have issue on Rocky is pointing to this code base only and not 2.4.x or 3.0
This branch code base only has this memory leak issue which I am addressing in my code changes, please reconsider
@chandrakant2023 The libcups project is ONLY for shipping the CUPS Library v3 and later. Any version of CUPS prior to 3.0 is provided via the CUPS project and that is the only place you can get that code. Any legacy code/branches for prior CUPS releases is entirely accidental and an artifact of preserving the git history from the original project.
@chandrakant2023 The libcups project is ONLY for shipping the CUPS Library v3 and later. Any version of CUPS prior to 3.0 is provided via the CUPS project and that is the only place you can get that code. Any legacy code/branches for prior CUPS releases is entirely accidental and an artifact of preserving the git history from the original project.
Thank you for this information.
There is memory leak by cupsArrayNew3(..) as its return pointer to allocated memory which we need to free while return like free(data.devices);