From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWQ4T-0006hh-0q for qemu-devel@nongnu.org; Fri, 13 Mar 2015 09:56:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWQ4S-0000xf-0j for qemu-devel@nongnu.org; Fri, 13 Mar 2015 09:56:12 -0400 Message-ID: <5502EC71.9000009@redhat.com> Date: Fri, 13 Mar 2015 07:56:01 -0600 From: Eric Blake MIME-Version: 1.0 References: <1426251334-29445-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1426251334-29445-1-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7RSHMdchr9qQ642usCDVdeFk2ukpff8Cp" Subject: Re: [Qemu-devel] [PATCH] vl: fix resource leak with monitor_fdset_add_fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, famz@redhat.com, zhaoshenglong@huawei.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7RSHMdchr9qQ642usCDVdeFk2ukpff8Cp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/13/2015 06:55 AM, Paolo Bonzini wrote: > monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP > command add_fd). Free it. >=20 > Signed-off-by: Paolo Bonzini > --- > v1->v2: line length [Fam], pass &error_abort [Shannon] > --- > vl.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 Reviewed-by: Eric Blake > diff --git a/vl.c b/vl.c > index eba5d4c..9eae8f9 100644 > --- a/vl.c > +++ b/vl.c > @@ -1011,6 +1011,7 @@ static int parse_add_fd(QemuOpts *opts, void *opa= que) > int fd, dupfd, flags; > int64_t fdset_id; > const char *fd_opaque =3D NULL; > + AddfdInfo *fdinfo; > =20 > fd =3D qemu_opt_get_number(opts, "fd", -1); > fdset_id =3D qemu_opt_get_number(opts, "set", -1); > @@ -1060,8 +1061,10 @@ static int parse_add_fd(QemuOpts *opts, void *op= aque) > } > =20 > /* add the duplicate fd, and optionally the opaque string, to the = fd set */ > - monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : fal= se, > - fd_opaque, NULL); > + fdinfo =3D monitor_fdset_add_fd(dupfd, true, fdset_id, > + fd_opaque ? true : false, fd_opaque,= I might have written !!fd_opaque (as cond ? true : false always looks so long), but that's cosmetic and doesn't affect the review. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --7RSHMdchr9qQ642usCDVdeFk2ukpff8Cp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVAuxxAAoJEKeha0olJ0NqFssIAICXlowBTcQ8/bShVH1Ixowh zy+fykBSJsqkk+Ofz0x+EbicVM9BOG0l5NuBepUtMlWuJtNQz6H5B+aop+e+wuZ3 rWwfCZH3YYVBBXhGp7mn21VXFN57v14I1avq9upSk8Mngm4oGSi00XHg1j/IH2k8 wfRszgI3Crf+HcALl26G+dgLAPRHfRGX6PmbxbE2aQHag5ReE0uf8ycka0Pk5hme CRnHvq4w6ImThKHPCrJmcxMV4IqkcB0fEM4TH+lDqEGFQM/BPJddYjXv15zep/i+ 7hRyBGQtgx7xjrWXMcGnAmuQGElFdrd4cRhtzcYdHTeM66rYdTMWzJYufCEGEMc= =MhPr -----END PGP SIGNATURE----- --7RSHMdchr9qQ642usCDVdeFk2ukpff8Cp--