kmodloader: remove redundant glob wildcard char
[project/ubox.git] / kmodloader.c
index 40edbf0..9fe7d7f 100644 (file)
@@ -762,7 +762,7 @@ static int main_modprobe(int argc, char **argv)
 static int main_loader(int argc, char **argv)
 {
        int gl_flags = GLOB_NOESCAPE | GLOB_MARK;
-       char *dir = "/etc/modules.d/*";
+       char *dir = "/etc/modules.d/";
        struct module *m;
        glob_t gl;
        char *path;
@@ -775,11 +775,15 @@ static int main_loader(int argc, char **argv)
        strcpy(path, dir);
        strcat(path, "*");
 
-       if (scan_loaded_modules())
+       if (scan_loaded_modules()) {
+               free (path);
                return -1;
+       }
 
-       if (scan_module_folders())
+       if (scan_module_folders()) {
+               free (path);
                return -1;
+       }
 
        syslog(LOG_INFO, "kmodloader: loading kernel modules from %s\n", path);