All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mcstransd: fix memory leak in new_context_str
@ 2020-05-12 17:52 bauen1
  2020-05-12 18:03 ` Roberts, William C
  2020-05-13 15:12 ` Petr Lautrbach
  0 siblings, 2 replies; 4+ messages in thread
From: bauen1 @ 2020-05-12 17:52 UTC (permalink / raw)
  To: selinux

The return value of context_new needs to be free with context_free.

Signed-off-by: bauen1 <j2468h@gmail.com>
---
 mcstrans/src/mcstrans.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mcstrans/src/mcstrans.c b/mcstrans/src/mcstrans.c
index 96bdbdff..2116b161 100644
--- a/mcstrans/src/mcstrans.c
+++ b/mcstrans/src/mcstrans.c
@@ -919,6 +919,7 @@ new_context_str(const security_context_t incon, const char *range) {
 	}
 	context_range_set(con, range);
 	rcon = strdup(context_str(con));
+	context_free(con);
 	if (!rcon) {
 		goto exit;
 	}
-- 
2.26.2


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

end of thread, other threads:[~2020-05-13 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12 17:52 [PATCH] mcstransd: fix memory leak in new_context_str bauen1
2020-05-12 18:03 ` Roberts, William C
2020-05-13 15:12 ` Petr Lautrbach
2020-05-13 15:52   ` William Roberts

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.