openssh-unix-dev May 2011 archive
Main Archive Page > Month Archives  > openssh-unix-dev archives
openssh-unix-dev: [patch] the memory which is allocated by match

[patch] the memory which is allocated by matchpathcon should be freed after it is useless

From: Rongqing Li <rongqing.li_at_nospam>
Date: Fri May 20 2011 - 04:39:40 GMT
To: <openssh-unix-dev@mindrot.org>, <djm@openbsd.org>

the memory which is allocated by matchpathcon should be
freed after it is useless

Signed-off-by: Roy Li <rongqing.li@windriver.com>
--- openbsd-compat/port-linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c @@ -217,8 +217,10 @@ ssh_selinux_setfscreatecon(const char *p setfscreatecon(NULL); return; } - if (matchpathcon(path, 0700, &context) == 0) + if (matchpathcon(path, 0700, &context) == 0) { setfscreatecon(context); + freecon(context); + } } #endif /* WITH_SELINUX */ _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev@mindrot.org https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev