All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] libsemanage:  free base immediately after expand
@ 2008-02-01 14:11 Stephen Smalley
  2008-02-01 15:39 ` Joshua Brindle
  2008-02-01 16:54 ` Todd Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Smalley @ 2008-02-01 14:11 UTC (permalink / raw)
  To: selinux; +Cc: Joshua Brindle, Todd C. Miller

Drop the base module immediately after expanding, so that the memory can
be reused for the remainder of the transaction.

Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>

---

 libsemanage/src/direct_api.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: trunk/libsemanage/src/direct_api.c
===================================================================
--- trunk/libsemanage/src/direct_api.c	(revision 2774)
+++ trunk/libsemanage/src/direct_api.c	(working copy)
@@ -642,6 +642,9 @@
 		retval = semanage_expand_sandbox(sh, base, &out);
 		if (retval < 0)
 			goto cleanup;
+	
+		sepol_module_package_free(base);
+		base = NULL;
 
 		dbase_policydb_attach((dbase_policydb_t *) pusers_base->dbase,
 				      out);
@@ -718,7 +721,6 @@
 	dbase_policydb_detach((dbase_policydb_t *) pbools->dbase);
 
 	free(mod_filenames);
-	sepol_module_package_free(base);
 	sepol_policydb_free(out);
 	semanage_release_trans_lock(sh);
 

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] libsemanage:  free base immediately after expand
  2008-02-01 14:11 [patch] libsemanage: free base immediately after expand Stephen Smalley
@ 2008-02-01 15:39 ` Joshua Brindle
  2008-02-01 16:54 ` Todd Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Joshua Brindle @ 2008-02-01 15:39 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: selinux, Todd C. Miller

Stephen Smalley wrote:
> Drop the base module immediately after expanding, so that the memory can
> be reused for the remainder of the transaction.
>
> Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
>
>   

Acked-By: Joshua Brindle <method@manicmethod.com>

> ---
>
>  libsemanage/src/direct_api.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: trunk/libsemanage/src/direct_api.c
> ===================================================================
> --- trunk/libsemanage/src/direct_api.c	(revision 2774)
> +++ trunk/libsemanage/src/direct_api.c	(working copy)
> @@ -642,6 +642,9 @@
>  		retval = semanage_expand_sandbox(sh, base, &out);
>  		if (retval < 0)
>  			goto cleanup;
> +	
> +		sepol_module_package_free(base);
> +		base = NULL;
>  
>  		dbase_policydb_attach((dbase_policydb_t *) pusers_base->dbase,
>  				      out);
> @@ -718,7 +721,6 @@
>  	dbase_policydb_detach((dbase_policydb_t *) pbools->dbase);
>  
>  	free(mod_filenames);
> -	sepol_module_package_free(base);
>  	sepol_policydb_free(out);
>  	semanage_release_trans_lock(sh);
>  
>
>   



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [patch] libsemanage:  free base immediately after expand
  2008-02-01 14:11 [patch] libsemanage: free base immediately after expand Stephen Smalley
  2008-02-01 15:39 ` Joshua Brindle
@ 2008-02-01 16:54 ` Todd Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Todd Miller @ 2008-02-01 16:54 UTC (permalink / raw)
  To: Stephen Smalley, selinux; +Cc: Joshua Brindle

Stephen Smalley wrote:
> Drop the base module immediately after expanding, so that the memory
> can be reused for the remainder of the transaction.
> 
> Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>

Acked-By: Todd C. Miller <tmiller@tresys.com>

 - todd



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-01 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-01 14:11 [patch] libsemanage: free base immediately after expand Stephen Smalley
2008-02-01 15:39 ` Joshua Brindle
2008-02-01 16:54 ` Todd Miller

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.