All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Richard Haines <richard_c_haines@btinternet.com>, selinux@tycho.nsa.gov
Subject: Re: [PATCH] libselinux: Free memory when processing media and x specfiles
Date: Tue, 15 Sep 2015 10:40:01 -0400	[thread overview]
Message-ID: <55F82DC1.7060809@tycho.nsa.gov> (raw)
In-Reply-To: <1442325075-5178-1-git-send-email-richard_c_haines@btinternet.com>

On 09/15/2015 09:51 AM, Richard Haines wrote:
> Ensure all memory is freed - checked using valgrind
> 
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>

Thanks, applied.

> ---
>  libselinux/src/label_media.c | 2 +-
>  libselinux/src/label_x.c     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libselinux/src/label_media.c b/libselinux/src/label_media.c
> index 725d5bd..c589ca3 100644
> --- a/libselinux/src/label_media.c
> +++ b/libselinux/src/label_media.c
> @@ -161,7 +161,7 @@ static void close(struct selabel_handle *rec)
>  	if (spec_arr)
>  	    free(spec_arr);
>  
> -	memset(data, 0, sizeof(*data));
> +	free(data);
>  }
>  
>  static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
> diff --git a/libselinux/src/label_x.c b/libselinux/src/label_x.c
> index 3f2ee1c..3d13b23 100644
> --- a/libselinux/src/label_x.c
> +++ b/libselinux/src/label_x.c
> @@ -188,7 +188,7 @@ static void close(struct selabel_handle *rec)
>  	if (spec_arr)
>  	    free(spec_arr);
>  
> -	memset(data, 0, sizeof(*data));
> +	free(data);
>  }
>  
>  static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
> 

      reply	other threads:[~2015-09-15 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 13:51 [PATCH] libselinux: Free memory when processing media and x specfiles Richard Haines
2015-09-15 14:40 ` Stephen Smalley [this message]

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=55F82DC1.7060809@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=richard_c_haines@btinternet.com \
    --cc=selinux@tycho.nsa.gov \
    /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.