]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Rework change for coverity.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 2 Nov 2021 20:05:09 +0000 (16:05 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 2 Nov 2021 20:05:09 +0000 (16:05 -0400)
cups/dest.c

index e4edef1ff3cf550ba3fc511f0b83266356b1312e..f90d085cf2243db539c66a273bf743ea8e04b794 100644 (file)
@@ -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);
   }
 
  /*