[libvirt] [PATCH] openvz: fix a simple bug in openvzListDefinedDomains()
Eric Blake
eblake at redhat.com
Fri Mar 18 15:37:41 UTC 2011
On 03/18/2011 08:59 AM, Jean-Baptiste Rouault wrote:
> This patch adds missing curly brackets to an if
> statement in openvzListDefinedDomains()
> ---
> src/openvz/openvz_driver.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
> index 0d64e19..7792136 100644
> --- a/src/openvz/openvz_driver.c
> +++ b/src/openvz/openvz_driver.c
> @@ -1444,9 +1444,10 @@ static int openvzListDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED,
> continue;
> }
> snprintf(vpsname, sizeof(vpsname), "%d", veid);
> - if (!(names[got] = strdup(vpsname)))
> + if (!(names[got] = strdup(vpsname))) {
> virReportOOMError();
> goto out;
> + }
Oh my. ACK and pushed.
Last time we found one of these nasty bugs, Jim was proposing the idea
of a code-indenter run, and look through the diff to see if
reindentations spot any bugs, but the diff ended up too large to be useful.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110318/b4e66de3/attachment-0001.sig>
More information about the libvir-list
mailing list