Fix static analyzer issue 67/223367/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 29 Jan 2020 06:07:38 +0000 (15:07 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 29 Jan 2020 06:07:38 +0000 (15:07 +0900)
Change-Id: I414283ee674f478663cf3567ba2afa6c60f45ac9
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
installer/pkgmgr_installer.c

index 52ef06afd03efa45e00ec31bdcd110dc91c41a8c..5183d37c6d96d7505e1fbd9211b7d6bdcb3d3ba3 100644 (file)
@@ -286,6 +286,10 @@ static int __send_signal_for_event_for_uid(pkgmgr_installer *pi, uid_t uid,
        data_len += gv_len;
 
        data = malloc(data_len);
+       if (data == NULL) {
+               ERR("out of memory");
+               return -1;
+       }
        ptr = data;
        memcpy(ptr, &name_size, sizeof(size_t));
        ptr += sizeof(size_t);