Research Menu

.
Skip Search Box

SELinux Mailing List

memory leak in services.c

From: Jason Tang <jtang_at_tresys.com>
Date: Fri, 26 Aug 2005 13:13:47 -0400


The following patch corrects a memory leak in sepol_context_to_sid() within libsepol/services.c. The context was malloc()ed but never free()ed afterwards.

-- 
Jason Tang / jtang@tresys.com

--- services.c-old 2005-08-26 12:19:01.000000000 -0400 +++ services.c 2005-08-26 12:18:18.000000000 -0400 @@ -548,11 +548,14 @@ int sepol_context_to_sid(sepol_security_ goto err; context_destroy(context); + free(context); return STATUS_SUCCESS; err: - if (context) + if (context) { context_destroy(context); + free(context); + } DEBUG(__FUNCTION__, "could not convert %s to sid\n", scontext); return STATUS_ERR; } -- 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.

Received on Fri 26 Aug 2005 - 13:13:57 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service