This commit is contained in:
Zdenek Dohnal 2020-04-14 13:56:49 +02:00
parent 5ab9f50bd8
commit 401449b6bf
4 changed files with 7 additions and 138 deletions

1
.gitignore vendored
View File

@ -96,3 +96,4 @@
/cups-filters-1.27.1.tar.xz
/cups-filters-1.27.2.tar.xz
/cups-filters-1.27.3.tar.xz
/cups-filters-1.27.4.tar.xz

View File

@ -1,131 +0,0 @@
diff --git a/cupsfilters/ppdgenerator.c b/cupsfilters/ppdgenerator.c
index 142d3042..fcd95e2c 100644
--- a/cupsfilters/ppdgenerator.c
+++ b/cupsfilters/ppdgenerator.c
@@ -435,7 +435,7 @@ const char *
_searchDirForCatalog(const char *dirname)
{
const char *catalog = NULL, *c1, *c2;
- cups_dir_t *dir, *subdir;
+ cups_dir_t *dir = NULL, *subdir;
cups_dentry_t *subdirentry, *catalogentry;
char subdirpath[1024], catalogpath[2048], lang[8];
int i;
@@ -499,6 +499,7 @@ _searchDirForCatalog(const char *dirname)
break;
}
cupsDirClose(subdir);
+ subdir = NULL;
if (catalog != NULL)
break;
}
@@ -749,13 +750,18 @@ load_opt_strings_catalog(const char *location, cups_array_t *options)
2: "..." = "..."
10: EOF, save last entry */
int digit;
+ int found_in_catalog = 0;
if (location == NULL || (strncasecmp(location, "http:", 5) &&
strncasecmp(location, "https:", 6))) {
if (location == NULL ||
(stat(location, &statbuf) == 0 &&
S_ISDIR(statbuf.st_mode))) /* directory? */
+ {
filename = _findCUPSMessageCatalog(location);
+ if (filename)
+ found_in_catalog = 1;
+ }
else
filename = location;
} else {
@@ -939,6 +945,8 @@ load_opt_strings_catalog(const char *location, cups_array_t *options)
free(opt_name);
if (filename == tmpfile)
unlink(filename);
+ if (found_in_catalog)
+ free(filename);
}
@@ -1948,10 +1956,16 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
} else {
if ((current_res = resolutionArrayNew()) != NULL) {
if ((current_def = resolutionNew(lowdpi, lowdpi)) != NULL)
+ {
cupsArrayAdd(current_res, current_def);
+ free_resolution(current_def, NULL);
+ }
if (hidpi != lowdpi &&
(current_def = resolutionNew(hidpi, hidpi)) != NULL)
+ {
cupsArrayAdd(current_res, current_def);
+ free_resolution(current_def, NULL);
+ }
current_def = NULL;
if (cupsArrayCount(current_res) > 0 &&
joinResolutionArrays(&common_res, &current_res, &common_def,
@@ -2069,7 +2083,10 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
if (common_res == NULL) {
if ((common_res = resolutionArrayNew()) != NULL) {
if ((current_def = resolutionNew(300, 300)) != NULL)
+ {
cupsArrayAdd(common_res, current_def);
+ free_resolution(current_def, NULL);
+ }
current_def = NULL;
} else
goto bad_ppd;
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index c649eab6..1a81d52c 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -7481,7 +7481,7 @@ gboolean update_cups_queues(gpointer unused) {
*color_space;
#endif
const char *loadedppd = NULL;
- ppd_file_t *ppd;
+ ppd_file_t *ppd = NULL;
ppd_choice_t *choice;
cups_file_t *in, *out;
char keyword[1024], *keyptr;
@@ -8413,6 +8413,7 @@ gboolean update_cups_queues(gpointer unused) {
p->timeout = current_time + TIMEOUT_RETRY;
p->no_autosave = 0;
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
break;
}
@@ -8423,6 +8424,7 @@ gboolean update_cups_queues(gpointer unused) {
p->no_autosave = 0;
cupsFileClose(out);
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
break;
}
@@ -8493,10 +8495,14 @@ gboolean update_cups_queues(gpointer unused) {
cupsFileClose(in);
cupsFileClose(out);
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
loadedppd = NULL;
if (ppdfile)
+ {
free(ppdfile);
+ ppdfile = NULL;
+ }
ppdfile = strdup(buf);
}
@@ -12438,6 +12444,9 @@ fail:
if (local_printers_context) {
browse_poll_cancel_subscription (local_printers_context);
+#ifdef HAVE_CUPS_2_0
+ free(local_printers_context->server);
+#endif
g_list_free_full (local_printers_context->printers,
browsepoll_printer_free);
free (local_printers_context);

View File

@ -3,8 +3,8 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.27.3
Release: 3%{?dist}
Version: 1.27.4
Release: 1%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
@ -27,8 +27,6 @@ Patch01: cups-filters-createall.patch
# instead of 'cups-browsed' as Ubuntu does. I can repack the project later,
# so cups-browsed would have separate sub package, so the link would be correct
Patch02: cups-browsed.8.patch
# memory issue in cups-browsed, backported from upstream
Patch03: cups-browsed-mem-issues.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -145,8 +143,6 @@ This is the development package for OpenPrinting CUPS filters and backends.
%patch01 -p1 -b .createall
# links in manpage
%patch02 -p1 -b .manpage
# memory issues in cups-browsed, backported from upstream
%patch03 -p1 -b .mem-issues
%build
# work-around Rpath
@ -312,6 +308,9 @@ done
%{_libdir}/libfontembed.so
%changelog
* Tue Apr 14 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.4-1
- 1.27.4
* Wed Apr 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.3-3
- memory issues in cups-browsed

View File

@ -1 +1 @@
SHA512 (cups-filters-1.27.3.tar.xz) = 48c8a1d2ee860733a5cae41e333c45a997916638ea05552f2ec915d2713ecc216658763089affc8165907caf2b929406232192d70d0c0877b72377390b46ffd3
SHA512 (cups-filters-1.27.4.tar.xz) = 8005e94bb6b06d0a15fa4dfd8455d0bc67418478bf517e205af1c8c0018681a97ae9ea486db07570050ebeeb7f63f75319a8fe012c112c6d16c0941299eaa50e