diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c index c312804..155b581 100644 --- a/utils/cups-browsed.c +++ b/utils/cups-browsed.c @@ -993,6 +993,10 @@ void generate_local_queue(const char *host, would get, so ignore this remote printer */ debug_printf("cups-browsed: Printer with URI %s already exists, printer ignored.\n", uri); + free (uri); + free (remote_host); + free (backup_queue_name); + cupsFreeDests(num_dests, dests); return; } /* Is there a local queue with the name of the remote queue? */ @@ -1027,6 +1031,7 @@ void generate_local_queue(const char *host, ignore this remote printer */ debug_printf("cups-browsed: %s also taken, printer ignored.\n", local_queue_name); + free (uri); free (backup_queue_name); free (remote_host); cupsFreeDests(num_dests, dests); @@ -2426,9 +2431,9 @@ int main(int argc, char*argv[]) { strcasecmp(val, "false") != 0) { /* Queue found, add to our list */ p = create_local_queue (dest->name, - strdup(cupsGetOption("device-uri", - dest->num_options, - dest->options)), + cupsGetOption("device-uri", + dest->num_options, + dest->options), "", "", "", "", NULL, 1); if (p) { /* Mark as unconfirmed, if no Avahi report of this queue appears