Fix memory leak in set*con calls.

This commit is contained in:
Dan Walsh 2013-03-06 12:18:42 -05:00
parent afe87e85a1
commit 9df78f0c3b
2 changed files with 19 additions and 3 deletions

View File

@ -410,6 +410,18 @@ index 2d7369e..2a00807 100644
va_end(ap);
}
diff --git a/libselinux/src/procattr.c b/libselinux/src/procattr.c
index 6c5b45a..0a0dd3e 100644
--- a/libselinux/src/procattr.c
+++ b/libselinux/src/procattr.c
@@ -257,6 +257,7 @@ out:
free(context);
return -1;
} else {
+ free(*prev_context);
*prev_context = context;
return 0;
}
diff --git a/libselinux/src/selinux_config.c b/libselinux/src/selinux_config.c
index 296f357..4913c55 100644
--- a/libselinux/src/selinux_config.c

View File

@ -10,7 +10,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.1.13
Release: 6%{?dist}
Release: 7%{?dist}
License: Public Domain
Group: System Environment/Libraries
Source: %{name}-%{version}.tgz
@ -173,6 +173,7 @@ rm -f %{buildroot}%{_sbindir}/setfilecon
rm -f %{buildroot}%{_sbindir}/selinuxconfig
rm -f %{buildroot}%{_sbindir}/selinuxdisable
rm -f %{buildroot}%{_sbindir}/getseuser
rm -f %{buildroot}%{_sbindir}/togglesebool
rm -f %{buildroot}%{_sbindir}/selinux_check_securetty_context
mv %{buildroot}%{_sbindir}/getdefaultcon %{buildroot}%{_sbindir}/selinuxdefcon
mv %{buildroot}%{_sbindir}/getconlist %{buildroot}%{_sbindir}/selinuxconlist
@ -199,13 +200,12 @@ rm -rf %{buildroot}
%{_sbindir}/avcstat
%{_sbindir}/getenforce
%{_sbindir}/getsebool
%{_sbindir}/matchpathcon
%{_sbindir}/selinuxconlist
%{_sbindir}/selinuxdefcon
%{_sbindir}/selinuxexeccon
%{_sbindir}/selinuxenabled
%{_sbindir}/setenforce
%{_sbindir}/matchpathcon
%{_sbindir}/togglesebool
%{_mandir}/man5/*
%{_mandir}/man8/*
@ -241,8 +241,12 @@ rm -rf %{buildroot}
%{ruby_sitearch}/selinux.so
%changelog
* Wed Mar 6 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.13-7
- Fix memory leak in set*con calls.
* Thu Feb 28 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.13-6
- Move matchpathcon to -utils package
- Remove togglesebool
* Thu Feb 21 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.13-5
- Fix selinux man page to reflect what current selinux policy is.