Rongqing Li
2011-May-20 04:39 UTC
[patch] the memory which is allocated by matchpathcon should be freed after it is useless
the memory which is allocated by matchpathcon should be freed after it is useless 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 */
Maybe Matching Threads
- [v1 PATCH 1/1] Free memory
- [v1 PATCH 0/1] Review request for a memory leak fix for openssh
- Please review openssh patch for selinux
- [Bug 1851] New: ssh_selinux_setfscreatecon segfaults if SELinux support is compiled in but is disabled at run-time
- [Bug 1850] New: Build fails when SELinux is enabled