Fix static analysis issue 59/307259/1
authorjusung son <jusung07.son@samsung.com>
Wed, 6 Mar 2024 10:19:42 +0000 (19:19 +0900)
committerjusung son <jusung07.son@samsung.com>
Wed, 6 Mar 2024 10:19:42 +0000 (19:19 +0900)
 - MISSING_LOCK

Change-Id: Ibf9adb79c881a6e09898316983dec2bf5f9abf20
Signed-off-by: jusung son <jusung07.son@samsung.com>
src/data_control_internal.c

index 5a7169b..6175560 100644 (file)
@@ -1619,9 +1619,11 @@ int _request_provider(data_control_h provider, datacontrol_request_type type,
 
        _LOGI("Data control request, type: %d, request id: %d", type, request_id);
 
+       pthread_mutex_lock(&__data_control_socket_mutex);
        if (__socket_pair_hash == NULL)
                __socket_pair_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
                                free, _socket_info_free);
+       pthread_mutex_unlock(&__data_control_socket_mutex);
 
        if (!__response_table) {
                _LOGE("The listener tree is empty");