41f522a
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecon/restorecon.c policycoreutils-1.21.13/restorecon/restorecon.c
41f522a
--- nsapolicycoreutils/restorecon/restorecon.c	2005-02-02 17:20:59.000000000 -0500
41f522a
+++ policycoreutils-1.21.13/restorecon/restorecon.c	2005-02-08 13:32:22.000000000 -0500
41f522a
@@ -118,8 +118,8 @@
41f522a
 int restore(char *filename) {
41f522a
   int retcontext=0;
41f522a
   int retval=0;
41f522a
-  security_context_t scontext;
41f522a
-  security_context_t prev_context;
41f522a
+  security_context_t scontext=NULL;
41f522a
+  security_context_t prev_context=NULL;
41f522a
   int len=strlen(filename);
41f522a
   struct stat st;
41f522a
   char path[PATH_MAX+1];
41f522a
@@ -185,6 +185,7 @@
41f522a
   
41f522a
   if (retcontext >= 0 || errno == ENODATA) {
41f522a
     int customizable=0;
41f522a
+    if (retcontext < 0) prev_context=NULL;
41f522a
     if (retcontext < 0 || 
41f522a
 	(strcmp(prev_context,scontext) != 0 && 	
41f522a
 	 !(customizable=(force ? 0: (is_context_customizable(prev_context) > 0))))) {