Fixes: debbugs:12444

* fileio.c (Ffile_selinux_context): Only call freecon when
lgetfilecon succeeded.
(Fset_file_selinux_context): Likewise.
This commit is contained in:
Andreas Schwab 2012-09-14 18:35:25 +02:00
parent f2016beaf3
commit c6ba413818
2 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2012-09-14 Andreas Schwab <schwab@linux-m68k.org>
* fileio.c (Ffile_selinux_context): Only call freecon when
lgetfilecon succeeded.
(Fset_file_selinux_context): Likewise. (Bug#12444)
2012-09-12 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (try_window_reusing_current_matrix): Under bidi

View file

@ -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