about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-06-26 22:09:32 -0400
committerRich Felker <dalias@aerifal.cx>2011-06-26 22:09:32 -0400
commit06933cc72445e12ee46b2930659eb5db0f9d6a43 (patch)
tree9ab9204e3bad1a0c4277eae37488ef708adeb858
parent97507bde474b0091a28628a7dae943c377758d49 (diff)
downloadmusl-06933cc72445e12ee46b2930659eb5db0f9d6a43.tar.gz
musl-06933cc72445e12ee46b2930659eb5db0f9d6a43.tar.xz
musl-06933cc72445e12ee46b2930659eb5db0f9d6a43.zip
don't leave the lock held on dlopen failure..
-rw-r--r--src/ldso/dynlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 1cab8d12..62dd9db7 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -509,7 +509,7 @@ void *dlopen(const char *file, int mode)
 	}
 
 	p = load_library(file);
-	if (!p) return 0;
+	if (!p) goto end;
 
 	/* First load handling */
 	if (!p->deps) {
@@ -531,8 +531,8 @@ void *dlopen(const char *file, int mode)
 		p->global = 1;
 	}
 
+end:
 	pthread_rwlock_unlock(&lock);
-
 	return p;
 }