浏览代码

don't leave the lock held on dlopen failure..

Rich Felker 13 年之前
父节点
当前提交
06933cc724
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/ldso/dynlink.c

+ 2 - 2
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;
 }