Skip to content

Commit

Permalink
scheduler/colorman.c: Fix memory leak during creating color profile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zdohnal authored Nov 24, 2023
2 parents 7a73012 + e5cdce9 commit 1f65989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGES - OpenPrinting CUPS 2.4.8 - TBA
Changes in CUPS v2.4.8 (TBA)
----------------------------

- Fixed memory leak when creating color profiles (Issue #815)
- Fixed memory leak when unloading a job (Issue #813)
- Raised `cups_enum_dests()` timeout for listing available IPP printers (Issue #751)
- Really backport fix for Issue #742
Expand Down
2 changes: 1 addition & 1 deletion scheduler/colorman.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ colord_create_profile(

dbus_message_iter_get_basic(&args, &profile_path);
cupsdLogMessage(CUPSD_LOG_DEBUG, "Created profile \"%s\".", profile_path);
cupsArrayAdd(profiles, strdup(profile_path));
cupsArrayAdd(profiles, profile_path);

out:

Expand Down

0 comments on commit 1f65989

Please sign in to comment.