]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixes: debbugs:12444
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 14 Sep 2012 16:35:25 +0000 (18:35 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 14 Sep 2012 16:35:25 +0000 (18:35 +0200)
* fileio.c (Ffile_selinux_context): Only call freecon when
lgetfilecon succeeded.
(Fset_file_selinux_context): Likewise.

src/ChangeLog
src/fileio.c

index 6b5b6e1455ddb89540f4e770fe0ed4de1bc98d92..0834ab9111ec27c07f3f6f67aa3dcbe1bd1791f1 100644 (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
index 3b8ed1430057121897c51f94d133418ab57b7680..c5979293feb2a0d8fe269d60be6413d34e48aaab 100644 (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