Explorar el Código

Fix missing unlock in error conditions reported by Kristen Smith

(Logical change 1.111)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@396 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake hace 21 años
padre
commit
6dbbb54af1
Se han modificado 3 ficheros con 6 adiciones y 5 borrados
  1. 2 2
      lib/amf.c
  2. 2 2
      lib/clm.c
  3. 2 1
      lib/evs.c

+ 2 - 2
lib/amf.c

@@ -246,7 +246,6 @@ saAmfDispatch (
 		 */
 		if (amfInstance->finalize == 1) {
 			error = SA_OK;
-			pthread_mutex_unlock (&amfInstance->mutex);
 			goto error_unlock;
 		}
 
@@ -392,8 +391,9 @@ saAmfDispatch (
 	} while (cont);
 
 error_unlock:
-	saHandleInstancePut (&amfHandleDatabase, *amfHandle);
+	pthread_mutex_unlock (&amfInstance->mutex);
 error_nounlock:
+	saHandleInstancePut (&amfHandleDatabase, *amfHandle);
 	return (error);
 }
 

+ 2 - 2
lib/clm.c

@@ -224,7 +224,6 @@ saClmDispatch (
 		 */
 		if (clmInstance->finalize == 1) {
 			error = SA_OK;
-			pthread_mutex_unlock (&clmInstance->mutex);
 			goto error_unlock;
 		}
 
@@ -325,8 +324,9 @@ saClmDispatch (
 	} while (cont);
 
 error_unlock:
-	saHandleInstancePut (&clmHandleDatabase, *clmHandle);
+	pthread_mutex_unlock (&clmInstance->mutex);
 error_nounlock:
+	saHandleInstancePut (&clmHandleDatabase, *clmHandle);
 	return (error);
 }
 

+ 2 - 1
lib/evs.c

@@ -373,8 +373,9 @@ evs_error_t evs_dispatch (
 	} while (cont);
 
 error_unlock:
-	saHandleInstancePut (&evs_handle_t_db, *handle);
+	pthread_mutex_unlock (&evs_inst->mutex);
 error_nounlock:
+	saHandleInstancePut (&evs_handle_t_db, *handle);
 	return (error);
 }