Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler/colorman.c: Fix memory leak during creating color profile #814

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Oct 30, 2023

Since the array profiles is set to use strdup() as a copy function, we don't have to use strdup() on the element which is passed as parameter of cupsArrayAdd() - using the strdup() as we used till now causes memory leak.

Reproducer is the same as #813 .

Since the array `profiles` is set to use `strdup()` as a copy function, we
don't have to use `strdup()` on the element which is passed as parameter
of `cupsArrayAdd()` - using the `strdup()` as we used till now causes
memory leak.

Reproducer is the same as OpenPrinting#813
.
Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zdohnal zdohnal merged commit 17985bb into OpenPrinting:master Nov 24, 2023
3 of 6 checks passed
zdohnal added a commit to zdohnal/cups that referenced this pull request Nov 27, 2023
The string which we add into array stays `const` after fixing OpenPrinting#814
(because `strdup()`, which caused memory leak returned `char *`) and
compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit to zdohnal/cups that referenced this pull request Nov 27, 2023
The string which we add into array stays `const` after fixing OpenPrinting#814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit to zdohnal/cups that referenced this pull request Nov 27, 2023
The string which we add into array stays `const` after fixing OpenPrinting#814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit to zdohnal/cups that referenced this pull request Nov 27, 2023
The string which we add into array stays `const` after fixing OpenPrinting#814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit to zdohnal/cups that referenced this pull request Nov 27, 2023
The string which we add into array stays `const` after fixing OpenPrinting#814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit that referenced this pull request Nov 29, 2023
The string which we add into array stays const after fixing #814 (because strdup(), which caused memory leak returned char *) and compiler fails because of it if it runs with '-Werror -Wall'.
zdohnal added a commit that referenced this pull request Nov 29, 2023
The string which we add into array stays `const` after fixing #814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants