File eject-2.1.0-regfree_segfault.patch of Package eject

Index: eject-2.1.0/eject.c
===================================================================
--- eject-2.1.0.orig/eject.c	2011-12-06 16:56:02.000000000 +0100
+++ eject-2.1.0/eject.c	2011-12-08 13:44:43.811127406 +0100
@@ -850,6 +850,7 @@
 	if (fp == NULL)
 	{
 		fprintf(stderr, _("unable to open %s: %s\n"),(p_option ? "/proc/mounts" : "/etc/mtab"), strerror(errno));
+		regfree(&preg);
 		exit(1);
 	}
 
@@ -883,10 +884,10 @@
 				if (v_option)
 					printf(_("%s: unmounting `%s'\n"), programName, s1);
 				Unmount(s1);
-				regfree(&preg);
 			}
 		}
 	}
+	regfree(&preg);
 	FCLOSE(fp);
 }
 
openSUSE Build Service is sponsored by