From 7107a2f38c5a675d484db2d0bc75d713ae1d9fc2 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 19 May 2006 11:25:30 +0000 Subject: [PATCH] - cleanup memory if opening aliases failed and cleanup was requested. (r15107 from trunk) --- modutils/modprobe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modutils/modprobe.c b/modutils/modprobe.c index c16151537..08dc0e06a 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -290,15 +290,15 @@ static struct dep_t *build_dep ( void ) } 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 ); -- 2.25.1