Re: sysinfo: fix lack of error check in virSysinfoFormat().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 27, 2011 at 04:40:56PM +0900, Minoru Usui wrote:
> Fix lack of error check in virSysinfoFormat().
> 
> Signed-off-by: Minoru Usui <usui@xxxxxxxxxxxxxxxxx>
> ---
>  src/util/sysinfo.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
> index 31ebdc2..bff1cb8 100644
> --- a/src/util/sysinfo.c
> +++ b/src/util/sysinfo.c
> @@ -796,6 +796,11 @@ virSysinfoFormat(virSysinfoDefPtr def, const char *prefix)
>  
>      virBufferAsprintf(&buf, "%s</sysinfo>\n", prefix);
>  
> +    if (virBufferError(&buf)) {
> +        virReportOOMError();
> +        return NULL;
> +    }
> +
>      return virBufferContentAndReset(&buf);
>  }

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]