diff --git a/cups-lspp.patch b/cups-lspp.patch index f7e4966..90f20ad 100644 --- a/cups-lspp.patch +++ b/cups-lspp.patch @@ -1740,7 +1740,7 @@ diff -up cups-1.4.1/scheduler/ipp.c.lspp cups-1.4.1/scheduler/ipp.c + + printerfile = strstr(printer->device_uri, "/dev/"); + if (printerfile == NULL && (strncmp(printer->device_uri, "file:/", 6) == 0)) -+ printerfile = strdup(printer->device_uri + strlen("file:/")); ++ printerfile = printer->device_uri + strlen("file:"); + + if (printerfile != NULL) + { @@ -2546,7 +2546,7 @@ diff -up cups-1.4.1/scheduler/job.c.lspp cups-1.4.1/scheduler/job.c + */ + printerfile = strstr(printer->device_uri, "/dev/"); + if (printerfile == NULL && (strncmp(printer->device_uri, "file:/", 6) == 0)) -+ printerfile = strdup(printer->device_uri + strlen("file:/")); ++ printerfile = printer->device_uri + strlen("file:"); + + if (printerfile != NULL) + { @@ -2776,7 +2776,7 @@ diff -up cups-1.4.1/scheduler/printers.c.lspp cups-1.4.1/scheduler/printers.c DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, -@@ -2296,6 +2309,42 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) +@@ -2296,6 +2309,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) attr->values[1].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[1]); } @@ -2788,12 +2788,15 @@ diff -up cups-1.4.1/scheduler/printers.c.lspp cups-1.4.1/scheduler/printers.c + printercon = 0; + printerfile = strstr(p->device_uri, "/dev/"); + if (printerfile == NULL && (strncmp(p->device_uri, "file:/", 6) == 0)) -+ printerfile = strdup(p->device_uri + strlen("file:/")); ++ printerfile = p->device_uri + strlen("file:"); + + if (printerfile != NULL) + { + if (getfilecon(printerfile, &devcon) == -1) -+ cupsdLogMessage(CUPSD_LOG_ERROR, "cupsdSetPrinterAttrs: Unable to get printer context"); ++ { ++ if(is_selinux_enabled()) ++ cupsdLogMessage(CUPSD_LOG_ERROR, "cupsdSetPrinterAttrs: Unable to get printer context"); ++ } + else + { + printercon = context_new(devcon); diff --git a/cups.spec b/cups.spec index 605c5ab..151f2d9 100644 --- a/cups.spec +++ b/cups.spec @@ -9,7 +9,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.4.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -509,6 +509,9 @@ rm -rf $RPM_BUILD_ROOT %{php_extdir}/phpcups.so %changelog +* Wed Nov 11 2009 Jiri Popelka 1:1.4.2-3 +- Fixed lspp-patch to avoid memory leak (bug #536741). + * Tue Nov 10 2009 Tim Waugh 1:1.4.2-2 - Added explicit version dependency on cups-libs to cups-lpd (bug #502205).