Casting for delete 26/256626/1
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 8 Apr 2021 07:19:06 +0000 (16:19 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 8 Apr 2021 07:19:14 +0000 (16:19 +0900)
Change-Id: Ifc3e1a2a78397452396ad1d6a1072c983dc73c3b
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/vine-disc.cpp
tool/tool_run.cpp

index f76970b..53d4d4a 100755 (executable)
@@ -167,13 +167,13 @@ static void __free_discovered_event(void *data)
        vine_discovered_event *discovered_event = (vine_discovered_event *)data;
 
        discovered_event->attributes.clear();
-       delete data;
+       delete discovered_event;
 }
 
 static void __free_ip_resolved_event(void *data)
 {
        VINE_LOGD("Free ip_resolved_event[%p]", data);
-       delete data;
+       delete (vine_ip_resolved_event *)data;
 }
 
 static void __published_cb(void *plugin_handle,
index 79d6db2..43cf194 100644 (file)
@@ -257,7 +257,7 @@ static int _send_message_from_file(vine_dp_h dp)
                fclose(file);
                return -1;
        }
-       buf = (unsigned char *)calloc(sizeof(unsigned char), size + 1);
+       buf = (unsigned char *)calloc(sizeof(unsigned char), size);
 
        fseek(file, 0, SEEK_SET);
        count = fread(buf, sizeof(unsigned char), size, file);