diff mbox

[3/4] policycoreutils/secon: free scon_trans before returning

Message ID 20180603162541.28136-3-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss June 3, 2018, 4:25 p.m. UTC
disp_con() leaks scon_trans if it returns early.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 policycoreutils/secon/secon.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/policycoreutils/secon/secon.c b/policycoreutils/secon/secon.c
index 6078139422ab..477057a6896b 100644
--- a/policycoreutils/secon/secon.c
+++ b/policycoreutils/secon/secon.c
@@ -646,6 +646,7 @@  static void disp_con(security_context_t scon_raw)
 			disp__con_val("clearance", NULL, &color);
 		if (opts->disp_mlsr)
 			disp__con_val("mls-range", NULL, &color);
+		freecon(scon_trans);
 		return;
 	}