Add exception handling 38/238338/1
authorJusung Son <jusung07.son@samsung.com>
Mon, 13 Jul 2020 02:39:48 +0000 (11:39 +0900)
committerJusung Son <jusung07.son@samsung.com>
Mon, 13 Jul 2020 02:39:48 +0000 (11:39 +0900)
 - DEREF_OF_NULL.RET.PROC.STAT

Change-Id: Ic84563d8b937fdf29b5bb369da8d09754e330902
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
src/eventsystem.c

index 84d5d80f1debf08f00136817f2573c8bff6221cc..e16cde37a0fb921bf06878047bd80d8882a35ef9 100644 (file)
@@ -205,12 +205,16 @@ static char *__get_encoded_interface_name(char *interface_name)
 
        encoded_value = g_compute_checksum_for_string(G_CHECKSUM_MD5,
                interface_name, strlen(interface_name));
+       if (encoded_value == NULL) {
+               _E("g_compute_checksum_for_string failed");
+               return NULL;
+       }
 
        evtid_len = EVENT_SYSTEM_PREFIX_LEN + strlen(encoded_value) + 1;
 
        evtid = (char *)calloc(evtid_len, sizeof(char));
        if (evtid == NULL) {
-               _D("memory alloc failed");
+               _E("memory alloc failed");
                g_free(encoded_value);
                return NULL;
        }