From: Zdenek Dohnal Date: Mon, 30 Oct 2023 09:49:14 +0000 (+0100) Subject: scheduler/colorman.c: Fix memory leak during creating color profile X-Git-Tag: v2.4.8~40^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec86249dbe8e71c5fd8eb7091adc41c83c4f747e;p=thirdparty%2Fcups.git scheduler/colorman.c: Fix memory leak during creating color profile 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 https://github.com/OpenPrinting/cups/pull/813 --- diff --git a/CHANGES.md b/CHANGES.md index 2daa4a86bb..f7dba2fac9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 - Raised `cups_enum_dests()` timeout for listing available IPP printers (Issue #751) - Really backport fix for Issue #742 diff --git a/scheduler/colorman.c b/scheduler/colorman.c index 809ed7c65d..9071271f0b 100644 --- a/scheduler/colorman.c +++ b/scheduler/colorman.c @@ -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: