From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org,
xen-devel@lists.xenproject.org, wl@xen.org
Subject: Re: [PATCH 2/3] mini-os: fix double free() in xenbus
Date: Thu, 9 Apr 2020 16:34:11 +0200 [thread overview]
Message-ID: <20200409143411.xa6ar7do64y7mpzf@function> (raw)
In-Reply-To: <20200409141240.28876-3-jgross@suse.com>
Juergen Gross, le jeu. 09 avril 2020 16:12:39 +0200, a ecrit:
> Commit 973ad0c4de1b48 ("Save/Restore Support: Add suspend/restore
> support for xenbus") introduced a double free of some memory and leaked
> another memory allocation.
>
> Fix those.
>
> Coverity-ID: 1433640
> Fixes: 973ad0c4de1b48 ("Save/Restore Support: Add suspend/restore support for xenbus")
> Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> xenbus/xenbus.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
> index d72dc3a..b12cef7 100644
> --- a/xenbus/xenbus.c
> +++ b/xenbus/xenbus.c
> @@ -413,9 +413,11 @@ void resume_xenbus(int canceled)
>
> rep = xenbus_msg_reply(XS_WATCH, XBT_NIL, req, ARRAY_SIZE(req));
> msg = errmsg(rep);
> - if (msg)
> + if (msg) {
> xprintk("error on XS_WATCH: %s\n", msg);
> - free(rep);
> + free(msg);
> + } else
> + free(rep);
> }
> }
>
> --
> 2.16.4
>
next prev parent reply other threads:[~2020-04-09 14:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 14:12 [PATCH 0/3] mini-os: fix several double frees and memory leaks Juergen Gross
2020-04-09 14:12 ` [PATCH 1/3] mini-os: fix double free() in netfront Juergen Gross
2020-04-09 14:33 ` Samuel Thibault
2020-04-09 14:12 ` [PATCH 2/3] mini-os: fix double free() in xenbus Juergen Gross
2020-04-09 14:34 ` Samuel Thibault [this message]
2020-04-09 14:12 ` [PATCH 3/3] mini-os: fix several memory leaks related to xenbus Juergen Gross
2020-04-09 14:35 ` Samuel Thibault
2020-04-09 14:46 ` Wei Liu
2020-04-09 14:30 ` [PATCH 0/3] mini-os: fix several double frees and memory leaks Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200409143411.xa6ar7do64y7mpzf@function \
--to=samuel.thibault@ens-lyon.org \
--cc=jgross@suse.com \
--cc=minios-devel@lists.xenproject.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.