diff options
-rw-r--r-- | util/module.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/module.c b/util/module.c index 214effb..9fd3030 100644 --- a/util/module.c +++ b/util/module.c @@ -202,18 +202,16 @@ static void module_load(module_init_type type) for (i = 0; i < ARRAY_SIZE(dirs); i++) { fname = g_strdup_printf("%s/%s%s", dirs[i], *mp, HOST_DSOSUF); ret = module_load_file(fname); + g_free(fname); + fname = NULL; /* Try loading until loaded a module file */ if (!ret) { break; } - g_free(fname); - fname = NULL; } if (ret == -ENOENT) { fprintf(stderr, "Can't find module: %s\n", *mp); } - - g_free(fname); } for (i = 0; i < ARRAY_SIZE(dirs); i++) { |