mcstransd: fix memory leak in new_context_str
PATCH 1/1 mcstransd: fix memory leak in new_context_str
The return value of context_new needs to be free with context_free.
--- mcstrans/src/mcstrans.c | 1 + 1 file changed, 1 insertion(+)
mcstrans/src/mcstrans.c +1 -0
@@ -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; }
Signature · 1 line
2.26.2
Quoted 26 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of bauen1
Sent: Tuesday, May 12, 2020 12:53 PM
To: selinux <[email protected]>
Subject: [PATCH] mcstransd: fix memory leak innew_context_strThe return value of
context_newneeds to be free withcontext_free.Signed-off-by bauen1 <[email protected]>--- mcstrans/src/mcstrans.c | 1 + 1 file changed, 1 insertion(+)mcstrans/src/mcstrans.c index renamed from mcstrans/src/mcstrans.c +0
-0
96bdbdff..2116b161100644mcstrans/src/mcstrans.c +1
-0@@ -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;
Quoted 3 lines
}
--
2.26.2
Petr Lautrbach
AppliedQuoted 4 lines · On Tue, May 12, 2020 at 07:52:54PM +0200, bauen1 wrote:
The return value of
context_newneeds to be free withcontext_free.Signed-off-by bauen1 <[email protected]>Acked-by William Roberts <[email protected]>
Applied.
Quoted 16 lines
--- mcstrans/src/mcstrans.c | 1 + 1 file changed, 1 insertion(+)mcstrans/src/mcstrans.c +1
-0@@ -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; }
Signature · 2 lines
() ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Quoted 8 lines · Petr Lautrbach
Quoted 4 lines · On Tue, May 12, 2020 at 07:52:54PM +0200, bauen1 wrote:
The return value of
context_newneeds to be free withcontext_free.Signed-off-by bauen1 <[email protected]>Acked-by William Roberts <[email protected]>Applied.
I updated the state to accepted in Patchwork
Quoted 21 lines
Quoted 10 lines
--- mcstrans/src/mcstrans.c | 1 + 1 file changed, 1 insertion(+)mcstrans/src/mcstrans.c +0
-0mcstrans/src/mcstrans.c new_context_str(const security_context_t incon, const char *range) { · line 925
Quoted 7 lines
mcstrans/src/mcstrans.c +1
-0@@ -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; }--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments