Răsfoiți Sursa

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 ani în urmă
părinte
comite
a81e56bd60
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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);