From: Andreas Schwab Date: Fri, 14 Sep 2012 16:35:25 +0000 (+0200) Subject: Fixes: debbugs:12444 X-Git-Tag: emacs-24.2.90~269^2~3^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c6ba413818be855fcc103fc74c40225db4fdab46;p=emacs.git Fixes: debbugs:12444 * fileio.c (Ffile_selinux_context): Only call freecon when lgetfilecon succeeded. (Fset_file_selinux_context): Likewise. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6b5b6e1455d..0834ab9111e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-14 Andreas Schwab + + * fileio.c (Ffile_selinux_context): Only call freecon when + lgetfilecon succeeded. + (Fset_file_selinux_context): Likewise. (Bug#12444) + 2012-09-12 Eli Zaretskii * xdisp.c (try_window_reusing_current_matrix): Under bidi diff --git a/src/fileio.c b/src/fileio.c index 3b8ed143005..c5979293feb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2841,9 +2841,8 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */) if (context_range_get (context)) values[3] = build_string (context_range_get (context)); context_free (context); + freecon (con); } - if (con) - freecon (con); } #endif @@ -2920,12 +2919,10 @@ compiled with SELinux support. */) report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); context_free (parsed_con); + freecon (con); } else report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); - - if (con) - freecon (con); } #endif