[lxc-devel] [PATCH 2/2] cgmanager: free line at end of check_supports_multiple_controllers

Stéphane Graber stgraber at ubuntu.com
Mon Apr 6 15:49:30 UTC 2015


On Tue, Mar 17, 2015 at 07:02:19PM -0500, serge at hallyn.com wrote:
> From: Serge Hallyn <serge.hallyn at ubuntu.com>
> 
> This is only called at startup so it wasn't a big leak, but it is a leak.
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/cgmanager.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index 0932d96..2eeed62 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -246,11 +246,12 @@ static void check_supports_multiple_controllers(pid_t pid)
>  		}
>  		if (strcmp(prevpath, colon) != 0) {
>  			cgm_all_controllers_same = false;
> -			fclose(f);
> -			return;
> +			break;
>  		}
>  	}
> +
>  	fclose(f);
> +	free(line);
>  }
>  
>  static int send_creds(int sock, int rpid, int ruid, int rgid)
> -- 
> 1.7.9.5
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150406/8553aed2/attachment.sig>


More information about the lxc-devel mailing list