fix segfault in kmodloader when no modules path was present
[project/ubox.git] / kmodloader.c
index e32e6affb64899a366cb81f6483865a061160891..5ba75c1aa36d24282991708c8bca019b5faa03ac 100644 (file)
@@ -609,7 +609,10 @@ static int main_insmod(int argc, char **argv)
                cur += sprintf(cur, "%s", argv[i]);
        }
 
-       init_module_folders();
+       if (init_module_folders()) {
+               fprintf(stderr, "falied to find the folder holding the modules\n");
+               return -1;
+       }
 
        if (get_module_path(argv[1])) {
                name = argv[1];