| 1 |
diff --git a/lib/fuse.c b/lib/fuse.c |
| 2 |
index 2a88918..34a46c3 100644 |
| 3 |
--- a/lib/fuse.c |
| 4 |
+++ b/lib/fuse.c |
| 5 |
@@ -242,50 +242,7 @@ static void fuse_unregister_module(struct fuse_module *m) |
| 6 |
|
| 7 |
static int fuse_load_so_module(const char *module) |
| 8 |
{ |
| 9 |
- int ret = -1; |
| 10 |
- char *tmp; |
| 11 |
- struct fusemod_so *so; |
| 12 |
- fuse_module_factory_t *factory; |
| 13 |
- |
| 14 |
- tmp = malloc(strlen(module) + 64); |
| 15 |
- if (!tmp) { |
| 16 |
- fuse_log(FUSE_LOG_ERR, "fuse: memory allocation failed\n"); |
| 17 |
- return -1; |
| 18 |
- } |
| 19 |
- sprintf(tmp, "libfusemod_%s.so", module); |
| 20 |
- so = calloc(1, sizeof(struct fusemod_so)); |
| 21 |
- if (!so) { |
| 22 |
- fuse_log(FUSE_LOG_ERR, "fuse: failed to allocate module so\n"); |
| 23 |
- goto out; |
| 24 |
- } |
| 25 |
- |
| 26 |
- so->handle = dlopen(tmp, RTLD_NOW); |
| 27 |
- if (so->handle == NULL) { |
| 28 |
- fuse_log(FUSE_LOG_ERR, "fuse: dlopen(%s) failed: %s\n", |
| 29 |
- tmp, dlerror()); |
| 30 |
- goto out_free_so; |
| 31 |
- } |
| 32 |
- |
| 33 |
- sprintf(tmp, "fuse_module_%s_factory", module); |
| 34 |
- factory = (fuse_module_factory_t*)dlsym(so->handle, tmp); |
| 35 |
- if (factory == NULL) { |
| 36 |
- fuse_log(FUSE_LOG_ERR, "fuse: symbol <%s> not found in module: %s\n", |
| 37 |
- tmp, dlerror()); |
| 38 |
- goto out_dlclose; |
| 39 |
- } |
| 40 |
- ret = fuse_register_module(module, *factory, so); |
| 41 |
- if (ret) |
| 42 |
- goto out_dlclose; |
| 43 |
- |
| 44 |
-out: |
| 45 |
- free(tmp); |
| 46 |
- return ret; |
| 47 |
- |
| 48 |
-out_dlclose: |
| 49 |
- dlclose(so->handle); |
| 50 |
-out_free_so: |
| 51 |
- free(so); |
| 52 |
- goto out; |
| 53 |
+ return -1; |
| 54 |
} |
| 55 |
|
| 56 |
static struct fuse_module *fuse_find_module(const char *module) |
| 57 |
@@ -335,7 +292,6 @@ static void fuse_put_module(struct fuse_module *m) |
| 58 |
else |
| 59 |
mp = &(*mp)->next; |
| 60 |
} |
| 61 |
- dlclose(so->handle); |
| 62 |
free(so); |
| 63 |
} |
| 64 |
} else if (!m->ctr) { |