- num_dests = cups_get_sdests(http, CUPS_GET_CLASSES, NULL, num_dests, dests);
+ if (cupsLastError() < IPP_REDIRECTION_OTHER_SITE)
+ num_dests = cups_get_sdests(http, CUPS_GET_CLASSES, NULL, num_dests, dests);
+
+ if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
+ {
+ cupsFreeDests(num_dests, *dests);
+ *dests = (cups_dest_t *)0;
+ return (0);
+ }