[libvirt] [PATCH 3/3] avoid fd leak

Eric Blake eblake at redhat.com
Wed May 30 13:08:33 UTC 2012


On 05/30/2012 03:20 AM, Wen Congyang wrote:
> virCommandRunAsync() will set errfd if it successes. We should

s/successes/succeeds/

> close it if virFDStreamOpenInternal() fails.
> 
> ---
>  src/fdstream.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/fdstream.c b/src/fdstream.c
> index d0ea0ee..f068439 100644
> --- a/src/fdstream.c
> +++ b/src/fdstream.c
> @@ -673,6 +673,7 @@ error:
>      VIR_FORCE_CLOSE(fds[0]);
>      VIR_FORCE_CLOSE(fds[1]);
>      VIR_FORCE_CLOSE(fd);
> +    VIR_FORCE_CLOSE(errfd);

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120530/d67c9434/attachment-0001.sig>


More information about the libvir-list mailing list