소스 검색

defect 1068
bug in saHandleDestroy could cause extra put on handle when the check is invalid


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@909 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 년 전
부모
커밋
a81e56bd60
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lib/util.c

+ 2 - 2
lib/util.c

@@ -610,13 +610,13 @@ saHandleDestroy (
 	pthread_mutex_lock (&handleDatabase->mutex);
 
 	if (check != handleDatabase->handles[handle].check) {
+		pthread_mutex_unlock (&handleDatabase->mutex);
 		error = SA_AIS_ERR_BAD_HANDLE;
-		goto error_exit;
+		return (error);
 	}
 
 	handleDatabase->handles[handle].state = SA_HANDLE_STATE_PENDINGREMOVAL;
 
-error_exit:
 	pthread_mutex_unlock (&handleDatabase->mutex);
 
 	saHandleInstancePut (handleDatabase, inHandle);