]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainFormatSchedDef: Avoid false positive NULL dereference
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Jun 2016 10:19:57 +0000 (12:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Jun 2016 11:59:44 +0000 (13:59 +0200)
commitf916194c7ee9d212be1a1b2ff28625fca3e13aec
treefd560bcfa4577290e4cb9996cb2d701ae0c9f163
parent09258c3c82acb1f562d8b65e89db5a9b175f9086
virDomainFormatSchedDef: Avoid false positive NULL dereference

Okay, I admit that our code here is complex. It's not easy to
spot that NULL deref can't really happen here. So it's no wonder
that a dumb compiler fails to see all the connections and
produces the following errors:

  CC       conf/libvirt_conf_la-domain_conf.lo
conf/domain_conf.c: In function 'virDomainDefFormatInternal':
conf/domain_conf.c:22162:22: error: potential null pointer dereference [-Werror=null-dereference]
             if (sched->policy == i)
                 ~~~~~^~~~~~~~
<snip/>
cc1: all warnings being treated as errors

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c