svn commit: branches/busybox_1_1_stable/modutils

aldot at busybox.net aldot at busybox.net
Fri May 19 11:25:32 UTC 2006


Author: aldot
Date: 2006-05-19 04:25:30 -0700 (Fri, 19 May 2006)
New Revision: 15120

Log:
- cleanup memory if opening aliases failed and cleanup was requested.
(r15107 from trunk)


Modified:
   branches/busybox_1_1_stable/modutils/modprobe.c


Changeset:
Modified: branches/busybox_1_1_stable/modutils/modprobe.c
===================================================================
--- branches/busybox_1_1_stable/modutils/modprobe.c	2006-05-19 11:24:28 UTC (rev 15119)
+++ branches/busybox_1_1_stable/modutils/modprobe.c	2006-05-19 11:25:30 UTC (rev 15120)
@@ -290,15 +290,15 @@
 	}
 
 	filename = bb_xasprintf("/lib/modules/%s/modules.dep", un.release );
-
-	if (( fd = open ( filename, O_RDONLY )) < 0 ) {
-
+	fd = open ( filename, O_RDONLY );
+	if (ENABLE_FEATURE_CLEAN_UP)
+		free(filename);
+	if (fd < 0) {
 		/* Ok, that didn't work.  Fall back to looking in /lib/modules */
 		if (( fd = open ( "/lib/modules/modules.dep", O_RDONLY )) < 0 ) {
 			return 0;
 		}
 	}
-	free(filename);
 
 	while ( reads ( fd, buffer, sizeof( buffer ))) {
 		int l = bb_strlen ( buffer );




More information about the busybox-cvs mailing list