From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH 27/28] mini-os: fix various memory leaks in various locations Date: Wed, 18 Sep 2013 13:54:57 +0200 Message-ID: <20130918115457.GT5664@type.bordeaux.inria.fr> References: <1379475484-25993-1-git-send-email-mattjd@gmail.com> <1379475484-25993-28-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1379475484-25993-28-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Matthew Daley, le Wed 18 Sep 2013 15:38:03 +1200, a =E9crit : > Coverity-ID: 1055827 > Coverity-ID: 1055828 > Coverity-ID: 1055829 > Coverity-ID: 1055830 > Coverity-ID: 1055831 > Signed-off-by: Matthew Daley Acked-by: Samuel Thibault > --- > extras/mini-os/kernel.c | 7 +++++-- > extras/mini-os/lib/xs.c | 2 ++ > 2 files changed, 7 insertions(+), 2 deletions(-) > = > diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c > index e9402b9..24fa25c 100644 > --- a/extras/mini-os/kernel.c > +++ b/extras/mini-os/kernel.c > @@ -84,8 +84,10 @@ static void shutdown_thread(void *p) > free(err); > xenbus_wait_for_watch(&events); > } > - xenbus_unwatch_path_token(XBT_NIL, path, token); > - xenbus_write(XBT_NIL, path, ""); > + err =3D xenbus_unwatch_path_token(XBT_NIL, path, token); > + if (err) free(err); > + err =3D xenbus_write(XBT_NIL, path, ""); > + if (err) free(err); > printk("Shutting down (%s)\n", shutdown); > = > if (!strcmp(shutdown, "poweroff")) > @@ -96,6 +98,7 @@ static void shutdown_thread(void *p) > /* Unknown */ > shutdown_reason =3D SHUTDOWN_crash; > app_shutdown(shutdown_reason); > + free(shutdown); > } > #endif > = > diff --git a/extras/mini-os/lib/xs.c b/extras/mini-os/lib/xs.c > index c603d17..324bd05 100644 > --- a/extras/mini-os/lib/xs.c > +++ b/extras/mini-os/lib/xs.c > @@ -144,6 +144,7 @@ char **xs_directory(struct xs_handle *h, xs_transacti= on_t t, > msg =3D xenbus_ls(t, path, &res); > if (msg) { > printk("xs_directory(%s): %s\n", path, msg); > + free(msg); > return NULL; > } > = > @@ -163,6 +164,7 @@ char **xs_directory(struct xs_handle *h, xs_transacti= on_t t, > } > = > *num =3D n; > + free(res); > return entries; > } > = > -- = > 1.7.10.4 > = -- = Samuel ***e trouve un .xls ***e passe un moment =E0 se demander quelle version de xml c'est =E7a, le .= xls e: donc j'ai fait un file.... -+- #sos - on n'a pas forc=E9ment les m=EAmes r=E9f=E9rences que tout le m= onde -+-