Add CONNECTION_MUTEX_UNLOCK in connection_create routine 02/37802/1
authorTaehee Yoo <ap420073@gmail.com>
Mon, 6 Apr 2015 10:45:18 +0000 (19:45 +0900)
committerTaehee Yoo <ap420073@gmail.com>
Mon, 6 Apr 2015 10:45:18 +0000 (19:45 +0900)
In the connection_create routine, it should unlock its mutex before returns
any values. But some routines do not unlock its mutex. So I add unlock code.

Change-Id: I87a864b797ab4bc9c50ab4655497ee9aecd6875d

src/connection.c

index 92c4ff6..55cbda8 100644 (file)
@@ -257,10 +257,12 @@ EXPORT_API int connection_create(connection_h* connection)
        rv = _connection_libnet_init();
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
+               CONNECTION_MUTEX_UNLOCK;
                return CONNECTION_ERROR_PERMISSION_DENIED;
        }
        else if (rv != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "Failed to create connection[%d]", rv);
+               CONNECTION_MUTEX_UNLOCK;
                return CONNECTION_ERROR_OPERATION_FAILED;
        }