cups-browsed.c: fix compiler warnings
@@ -3759,7 +3759,7 @@ get_printer_uuid(http_t *http_printer,
{
ipp_t *response = NULL;
ipp_attribute_t *attr = NULL;
- char * uuid = NULL;
+ const char * uuid = NULL;
const char * const pattrs[] = {
"printer-uuid",
@@ -7616,11 +7616,11 @@ gboolean update_cups_queues(gpointer unused) {
ipp_t *printer_attributes = NULL;
cups_array_t *sizes=NULL;
ipp_t *printer_ipp_response;
- char *make_model;
+ char *make_model = NULL;
const char *pdl=NULL;
int color;
int duplex;
- char *default_pagesize;
+ char *default_pagesize = NULL;
const char *default_color = NULL;
int cups_queues_updated = 0;
@@ -8189,17 +8189,27 @@ gboolean update_cups_queues(gpointer unused) {
}
if (num_cluster_printers != 1) {
+ if (default_pagesize != NULL) {
free(default_pagesize);
default_pagesize = NULL;
+ }
+ if (make_model != NULL) {
free(make_model);
make_model = NULL;
+ }
+ if (conflicts != NULL) {
cupsArrayDelete(conflicts);
conflicts = NULL;
+ }
+ if (printer_attributes != NULL) {
ippDelete(printer_attributes);
printer_attributes = NULL;
+ }
+ if (sizes != NULL) {
cupsArrayDelete(sizes);
sizes = NULL;
}
+ }
} else if (IPPPrinterQueueType == PPD_NO) {
ppdfile = NULL;
@@ -8518,17 +8528,27 @@ gboolean update_cups_queues(gpointer unused) {
}
if (num_cluster_printers != 1) {
+ if (default_pagesize != NULL) {
free(default_pagesize);
default_pagesize = NULL;
+ }
+ if (make_model != NULL) {
free(make_model);
make_model = NULL;
+ }
+ if (conflicts != NULL) {
cupsArrayDelete(conflicts);
conflicts = NULL;
+ }
+ if (printer_attributes != NULL) {
ippDelete(printer_attributes);
printer_attributes = NULL;
+ }
+ if (sizes != 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),
