rongqing.li at windriver.com
2011-Mar-31 08:25 UTC
[v1 PATCH 0/1] Review request for a memory leak fix for openssh
---------------------------------------------------- Summary: fix a memory leak for Openssh ---------------------------------------------------- Upstream Project Name: OpenSSH Upstream Project URL: anoncvs at anoncvs.mindrot.org:/cvs Applies to: anoncvs at anoncvs.mindrot.org:/cvs Brief Description: the memory which is allocated by matchpathcon should be freed after it is used Will Submit to: Damien Miller. <djm at openbsd.org> ; openssh-unix-dev at mindrot.org Origin of patch: Discovered by me Comments: --------- the memory which is allocated by matchpathcon should be freed after it is used Added Files: ------------ None. Removed Files: -------------- None. Remaining Changes (diffstat): ----------------------------- openbsd-compat/port-linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Testings I've done: ------------------- run ssh
The memory which is allocated by matchpathcon should be freed after it is used Signed-off-by: Roy Li <rongqing.li at 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 */