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

Re: [Xen-devel] [PATCH 22/28] mini-os: fix various memory leaks in blkfront



Matthew Daley, le Wed 18 Sep 2013 15:37:58 +1200, a écrit :
> Coverity-ID: 1055814
> Coverity-ID: 1055815
> Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>

Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  extras/mini-os/blkfront.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c
> index ddcf665..aead6bd 100644
> --- a/extras/mini-os/blkfront.c
> +++ b/extras/mini-os/blkfront.c
> @@ -250,7 +250,7 @@ error:
>  
>  void shutdown_blkfront(struct blkfront_dev *dev)
>  {
> -    char* err = NULL;
> +    char* err = NULL, *err2;
>      XenbusState state;
>  
>      char path[strlen(dev->backend) + strlen("/state") + 1];
> @@ -295,12 +295,15 @@ void shutdown_blkfront(struct blkfront_dev *dev)
>  
>  close:
>      if (err) free(err);
> -    xenbus_unwatch_path_token(XBT_NIL, path, path);
> +    err2 = xenbus_unwatch_path_token(XBT_NIL, path, path);
> +    if (err2) free(err2);
>  
>      snprintf(nodename, sizeof(nodename), "%s/ring-ref", dev->nodename);
> -    xenbus_rm(XBT_NIL, nodename);
> +    err2 = xenbus_rm(XBT_NIL, nodename);
> +    if (err2) free(err2);
>      snprintf(nodename, sizeof(nodename), "%s/event-channel", dev->nodename);
> -    xenbus_rm(XBT_NIL, nodename);
> +    err2 = xenbus_rm(XBT_NIL, nodename);
> +    if (err2) free(err2);
>  
>      if (!err)
>          free_blkfront(dev);
> -- 
> 1.7.10.4
> 

-- 
Samuel
<b> il faut combien de chevaux pour tirer une doloréan à 88 morph ?
***b vient de remarque que 88 mph c'est 142 km/h
<y> aaaaah
<y> c'est pour ça qu'ils limitent à 130 km/h sur les autoroutes
<y> c'est pour éviter que les gens voyagent dans le temps
<b> probablement

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.