The conditional setting of cmdout in networkBuildDhcpDaemonCommandLine()
caused Coverity to complain that 'cmd' could be leaked if !cmdout. Since
the function is local and only called with cmdout being passed those checks
have been removed.
}
/* build the dnsmasq command line */
-static int
-networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network, virCommandPtr *cmdout,
+static int ATTRIBUTE_NONNULL(2)
+networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network,
+ virCommandPtr *cmdout,
char *pidfile, dnsmasqContext *dctx,
dnsmasqCapsPtr caps)
{
cmd = virCommandNew(dnsmasqCapsGetBinaryPath(caps));
virCommandAddArgFormat(cmd, "--conf-file=%s", configfile);
-
- if (cmdout)
- *cmdout = cmd;
+ *cmdout = cmd;
ret = 0;
cleanup:
- if (ret < 0)
- virCommandFree(cmd);
return ret;
}