_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;
break;
}
cupsDirClose(subdir);
+ subdir = NULL;
if (catalog != NULL)
break;
}
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 {
free(opt_name);
if (filename == tmpfile)
unlink(filename);
+ if (found_in_catalog)
+ free(filename);
}
} 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, ¤t_res, &common_def,
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;
*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;
p->timeout = current_time + TIMEOUT_RETRY;
p->no_autosave = 0;
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
break;
}
p->no_autosave = 0;
cupsFileClose(out);
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
break;
}
cupsFileClose(in);
cupsFileClose(out);
ppdClose(ppd);
+ ppd = NULL;
unlink(loadedppd);
loadedppd = NULL;
if (ppdfile)
+ {
free(ppdfile);
+ ppdfile = NULL;
+ }
ppdfile = strdup(buf);
}
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);