struct v3_event_map * map = &(vm->event_map);
int i = 0;
- map->events = V3_Malloc(sizeof(struct list_head) * V3_EVENT_INVALID);
+ map->events = V3_Malloc(sizeof(struct list_head) * (V3_EVENT_INVALID+1));
if (map->events == NULL) {
PrintError(vm, VCORE_NONE, "Error: could not allocate event map\n");
return -1;
}
+ // dead code if there are no events, but this is correct
for (i = 0; i < V3_EVENT_INVALID; i++) {
INIT_LIST_HEAD(&(map->events[i]));
}
struct v3_event_map * map = &(vm->event_map);
int i = 0;
+
+ // dead code if there are no events, but this is correct
for (i = 0; i < V3_EVENT_INVALID; i++) {
if (!list_empty(&(map->events[i]))) {
struct v3_notifier * tmp_notifier = NULL;