All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Zarsky <jzarsky@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH] libsemanage: free genhomedircon fallback user
Date: Mon,  6 Nov 2017 16:35:30 +0100	[thread overview]
Message-ID: <20171106153530.5390-1-jzarsky@redhat.com> (raw)

Function semanage_genhomedircon() adds fallback user and function
setup_fallback_user() may add another one. But only one fallback
user is freed. Make sure to free all fallback users in
semanage_genhomedircon().

Signed-off-by: Jan Zarsky <jzarsky@redhat.com>
---
 libsemanage/src/genhomedircon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c
index 27a269ea..d09d82ff 100644
--- a/libsemanage/src/genhomedircon.c
+++ b/libsemanage/src/genhomedircon.c
@@ -1385,7 +1385,9 @@ done:
 	if (out != NULL)
 		fclose(out);
 
-	pop_user_entry(&(s.fallback));
+	while (s.fallback)
+		pop_user_entry(&(s.fallback));
+
 	ignore_free();
 
 	return retval;
-- 
2.14.3

             reply	other threads:[~2017-11-06 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 15:35 Jan Zarsky [this message]
2017-11-08  6:58 ` [PATCH] libsemanage: free genhomedircon fallback user Jason Zaman

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=20171106153530.5390-1-jzarsky@redhat.com \
    --to=jzarsky@redhat.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.