Fix memory leak 22/314522/2
authorjusung son <jusung07.son@samsung.com>
Mon, 15 Jul 2024 01:37:40 +0000 (10:37 +0900)
committerjusung son <jusung07.son@samsung.com>
Mon, 15 Jul 2024 01:39:14 +0000 (01:39 +0000)
Change-Id: I20219c524756c7f9fb72cd9b4fd2c8e02d370aec
Signed-off-by: jusung son <jusung07.son@samsung.com>
src/message_port_remote.c

index 093a5d2..44b03e1 100644 (file)
@@ -571,6 +571,7 @@ static void __receive_message(GVariant *parameters, GDBusMethodInvocation *invoc
        message_port_lock_mutex();
        if (!is_local_port_registed(remote_port, remote_trusted, &local_reg_id, &mi)) {
                _LOGE("Invalid argument : remote_port:(%s) trusted(%d)", remote_port, remote_trusted);
+               bundle_free(data);
                message_port_unlock_mutex();
                return;
        }
@@ -581,6 +582,7 @@ static void __receive_message(GVariant *parameters, GDBusMethodInvocation *invoc
 
        if (strcmp(remote_port, mi->port_name) != 0) {
                _LOGE("Invalid argument : remote_port (%s)", remote_port);
+               bundle_free(data);
                message_port_unlock_mutex();
                return;
        }
@@ -597,6 +599,7 @@ static void __receive_message(GVariant *parameters, GDBusMethodInvocation *invoc
                                } else {
                                        _LOGE("The application (%s) is not signed with the same certificate",
                                                        local_appid);
+                                       bundle_free(data);
                                        message_port_unlock_mutex();
                                        return;
                                }