ippAddStrings(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_MIMETYPE,
attributes[attr_no], num_value, NULL,
(const char * const *)values);
+
+ for (int k = 0; k < i; k++) {
+ free(values[k]);
+ values[k] = NULL;
+ }
}
+ cupsArrayDelete(list);
+ list = NULL;
}
- cupsArrayDelete(list);
}
/*add_tagzero_attributes - Adds attribute to the merged_attribute variable for
IPP_CONST_TAG(IPP_TAG_KEYWORD),
attributes[attr_no], num_value, NULL,
(const char * const *)values);
+
+ for (int k = 0; k < i; k++) {
+ free(values[k]);
+ values[k] = NULL;
+ }
}
+ cupsArrayDelete(list);
+ list = NULL;
}
- cupsArrayDelete(list);
}
/*add_keyword_attributes - Adds attributes to the merged_attribute variable for
ippAddStrings(*merged_attributes, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
attributes[attr_no], num_value, NULL,
(const char * const *)values);
+
+ for (int k = 0; k < i; k++) {
+ free(values[k]);
+ values[k] = NULL;
+ }
}
+ cupsArrayDelete(list);
+ list = NULL;
}
- cupsArrayDelete(list);
}
/*add_enum_attributes - Adds attributes to the merged_attribute variable for
{
int count, i, value;
remote_printer_t *p;
- char *str;
+ char *str = NULL;
char *q;
cups_array_t *list;
ipp_attribute_t *attr;
ippAddIntegers(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_ENUM,
attributes[attr_no], num_value,values);
}
+
+ if (str != NULL) {
+ free(str);
+ str = NULL;
+ }
+ cupsArrayDelete(list);
+ list = NULL;
}
- cupsArrayDelete(list);
}
/*add_margin_attribute - Adds margin attributes to the merged_attribute variable for the cluster.*/
ippAddIntegers(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_INTEGER,
attributes[attr_no], num_value,values);
}
+
+ if (str != NULL) {
+ free(str);
+ str = NULL;
+ }
+ cupsArrayDelete(list);
+ list = NULL;
}
- cupsArrayDelete(list);
}
/*add_resolution_attributes - Adds resolution attributes to the merged_attribute
attributes[attr_no], num_resolution,
IPP_RES_PER_INCH, xres, yres);
}
+ cupsArrayDelete(res_array);
+ res_array = NULL;
}
- cupsArrayDelete(res_array);
}
/*add_mediasize_attribute - Adds media sizes to the merged_attribute for the
}
}
}
+
+ free(temp);
+ free(temp_range);
cupsArrayDelete(sizes);
+ cupsArrayDelete(size_ranges);
}
/*add_mediadatabase_attribute - Adds media-col-database attributes for the
}
}
}
+
+ free(temp);
cupsArrayDelete(media_database);
}
}
}
- if (num_preset == 0)
+ if (num_preset == 0) {
+ cupsArrayDelete(list);
+ cupsArrayDelete(added_presets);
return;
+ }
preset_attribute = ippAddCollections(*merged_attributes, IPP_TAG_PRINTER,
"job-presets-supported", num_preset,
}
}
}
+
+ cupsArrayDelete(list);
+ cupsArrayDelete(added_presets);
}
/* get_pagesize: Function returns the standard/custom page size using
cupsArrayAdd(page_media, ppdsizename);
}
free(ppdsizename);
+ cupsArrayDelete(sizes);
+
return page_media;
}
}
}
}
+
+ cupsArrayDelete(sizes);
+ sizes = NULL;
}
}
+
+ cupsArrayDelete(sizes_ppdname);
+
return cluster_sizes;
}
cupsArrayAdd(pagesizes, ppdsizename);
}
cluster_options[i] = pagesizes;
+
+ cupsArrayDelete(sizes);
+ sizes = NULL;
}
}
cupsArrayAdd(conflict_pairs, constraint);
}
}
+
+ cupsArrayDelete(printer_second_options);
+ printer_second_options = NULL;
}
}
+
+ cupsArrayDelete(printer_first_options);
+ printer_first_options = NULL;
}
}
+
+ for(i = 0; i < no_of_ppd_keywords; i ++) {
+ cupsArrayDelete(cluster_options[i]);
+ }
+
free(ppdsizename);
return conflict_pairs;
}
temp->bottom_margin,
temp->media_source, temp->media_type);
ippSetCollection(*merged_attributes, &media_col_default, 0, current_media);
+
+ free(temp);
}
/*Finding the default colormodel for the cluster*/
const char* raw_uri)
{
ipp_t *response = NULL;
- ipp_attribute_t *attr;
+ ipp_attribute_t *attr = NULL;
+ char * uuid = NULL;
const char * const pattrs[] = {
"printer-uuid",
}
attr = ippFindAttribute(response, "printer-uuid", IPP_TAG_URI);
+
+
if (attr)
- return (ippGetString(attr, 0, NULL) + 9);
+ uuid = ippGetString(attr, 0, NULL) + 9;
else {
debug_printf ("Printer with URI %s: Cannot read \"printer-uuid\" IPP attribute!\n",
raw_uri);
- return NULL;
}
+
+ ippDelete(response);
+
+ return uuid;
}
static void
ppdfile = strdup(buffer);
}
}
+
+ if (num_cluster_printers != 1) {
+ free(default_pagesize);
+ default_pagesize = NULL;
+ free(make_model);
+ make_model = NULL;
+ cupsArrayDelete(conflicts);
+ conflicts = NULL;
+ ippDelete(printer_attributes);
+ printer_attributes = NULL;
+ cupsArrayDelete(sizes);
+ sizes = NULL;
+ }
} else if (IPPPrinterQueueType == PPD_NO) {
ppdfile = NULL;
}
}
}
+
+ if (num_cluster_printers != 1) {
+ free(default_pagesize);
+ default_pagesize = NULL;
+ free(make_model);
+ make_model = NULL;
+ cupsArrayDelete(conflicts);
+ conflicts = NULL;
+ ippDelete(printer_attributes);
+ printer_attributes = NULL;
+ cupsArrayDelete(sizes);
+ sizes = NULL;
+ }
} else {
/* Device URI: using implicitclass backend for IPP network printer */
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
cupsFilePrintf(out, "%s\n", line);
}
/* Save the NickName of the PPD to check whether external
- manipulations of the print queue have replaced the PPD */
- if (!strncmp(line, "*NickName:", 10)) {
+ manipulations of the print queue have replaced the PPD.
+ Check whether nickname is defined too */
+ if (!strncmp(line, "*NickName:", 10) && p->nickname == NULL) {
ptr = strchr(line, '"');
if (ptr) {
ptr ++;