Просмотр исходного кода

hdb: unlock hdb database when instance init fails

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse 12 лет назад
Родитель
Сommit
ac2ce81429
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      include/corosync/hdb.h

+ 1 - 0
include/corosync/hdb.h

@@ -161,6 +161,7 @@ static inline int hdb_handle_create (
 
 
 	instance = (void *)malloc (instance_size);
 	instance = (void *)malloc (instance_size);
 	if (instance == 0) {
 	if (instance == 0) {
+		hdb_database_unlock (&handle_database->lock);
 		errno = ENOMEM;
 		errno = ENOMEM;
 		return (-1);
 		return (-1);
 	}
 	}