diff options
| author | Andreas Schwab | 2012-09-14 18:35:25 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2012-09-14 18:35:25 +0200 |
| commit | c6ba413818be855fcc103fc74c40225db4fdab46 (patch) | |
| tree | 038d1ce084c027fe28dbe212e2426d2824a46298 | |
| parent | f2016beaf388cab00ab1cef9c52f7790115a2da3 (diff) | |
| download | emacs-c6ba413818be855fcc103fc74c40225db4fdab46.tar.gz emacs-c6ba413818be855fcc103fc74c40225db4fdab46.zip | |
Fixes: debbugs:12444
* fileio.c (Ffile_selinux_context): Only call freecon when
lgetfilecon succeeded.
(Fset_file_selinux_context): Likewise.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/fileio.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6b5b6e1455d..0834ab9111e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-09-14 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * fileio.c (Ffile_selinux_context): Only call freecon when | ||
| 4 | lgetfilecon succeeded. | ||
| 5 | (Fset_file_selinux_context): Likewise. (Bug#12444) | ||
| 6 | |||
| 1 | 2012-09-12 Eli Zaretskii <eliz@gnu.org> | 7 | 2012-09-12 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (try_window_reusing_current_matrix): Under bidi | 9 | * 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. */) | |||
| 2841 | if (context_range_get (context)) | 2841 | if (context_range_get (context)) |
| 2842 | values[3] = build_string (context_range_get (context)); | 2842 | values[3] = build_string (context_range_get (context)); |
| 2843 | context_free (context); | 2843 | context_free (context); |
| 2844 | freecon (con); | ||
| 2844 | } | 2845 | } |
| 2845 | if (con) | ||
| 2846 | freecon (con); | ||
| 2847 | } | 2846 | } |
| 2848 | #endif | 2847 | #endif |
| 2849 | 2848 | ||
| @@ -2920,12 +2919,10 @@ compiled with SELinux support. */) | |||
| 2920 | report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); | 2919 | report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); |
| 2921 | 2920 | ||
| 2922 | context_free (parsed_con); | 2921 | context_free (parsed_con); |
| 2922 | freecon (con); | ||
| 2923 | } | 2923 | } |
| 2924 | else | 2924 | else |
| 2925 | report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); | 2925 | report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); |
| 2926 | |||
| 2927 | if (con) | ||
| 2928 | freecon (con); | ||
| 2929 | } | 2926 | } |
| 2930 | #endif | 2927 | #endif |
| 2931 | 2928 | ||