From: Michael R Sweet Date: Tue, 2 Nov 2021 20:05:09 +0000 (-0400) Subject: Rework change for coverity. X-Git-Tag: v2.4rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef8d4274450bb7d2b1945af14a1e6f7c3dbf94bd;p=thirdparty%2Fcups.git Rework change for coverity. --- diff --git a/cups/dest.c b/cups/dest.c index e4edef1ff3..f90d085cf2 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -2831,16 +2831,16 @@ cups_dnssd_get_device( !strcmp(regtype, "_ipps._tcp") ? "IPPS" : "IPP", replyDomain)); - if ((device = calloc(sizeof(_cups_dnssd_device_t), 1)) != NULL) - { - device->dest.name = _cupsStrAlloc(name); - device->domain = _cupsStrAlloc(replyDomain); - device->regtype = _cupsStrAlloc(regtype); + if ((device = calloc(sizeof(_cups_dnssd_device_t), 1)) == NULL) + return (NULL); - device->dest.num_options = cupsAddOption("printer-info", serviceName, 0, &device->dest.options); + device->dest.name = _cupsStrAlloc(name); + device->domain = _cupsStrAlloc(replyDomain); + device->regtype = _cupsStrAlloc(regtype); - cupsArrayAdd(data->devices, device); - } + device->dest.num_options = cupsAddOption("printer-info", serviceName, 0, &device->dest.options); + + cupsArrayAdd(data->devices, device); } /*