summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-12 00:15:46 -0800
committerJeremy Allison <jra@samba.org>2008-01-12 00:15:46 -0800
commit360673e80e8d46167afb6c393773895b369ff290 (patch)
treeaba57df29253f559df818c4086003ecc457e161b /source3
parentaa8818bcc38dc3993bc41776ba29adb906c3dd66 (diff)
downloadsamba-360673e80e8d46167afb6c393773895b369ff290.tar.gz
samba-360673e80e8d46167afb6c393773895b369ff290.tar.bz2
samba-360673e80e8d46167afb6c393773895b369ff290.zip
CID 458. Don't leak dlopen handles on failing to load
module. Jeremy. (This used to be commit 8809eaeb154ea12543455f589e31172dc905d83a)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/module.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/lib/module.c b/source3/lib/module.c
index fa06d14b49..285bd9c4c0 100644
--- a/source3/lib/module.c
+++ b/source3/lib/module.c
@@ -57,6 +57,7 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
if (error) {
DEBUG(0, ("Error trying to resolve symbol 'init_module' in %s: %s\n",
module_name, error));
+ sys_dlclose(handle);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -66,6 +67,7 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Module '%s' initialization failed: %s\n",
module_name, get_friendly_nt_error_msg(status)));
+ sys_dlclose(handle);
}
return status;