]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix potential false-positive OOM error reporting.
authorMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 21 Oct 2009 20:27:09 +0000 (22:27 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 22 Oct 2009 13:25:45 +0000 (15:25 +0200)
commit4ed2c3773e0c462ba3af628f62357cc6d9b61718
treef6183392d3302688cb0bf70a20ce76e1bdcc5629
parent2f4682a9f8b76299a2c529d2aebc68f706e09ede
Fix potential false-positive OOM error reporting.

If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.

Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.

* src/conf/node_device_conf.c: only report an OOM error if there
  really is one
src/conf/node_device_conf.c