1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix crashes in hook and path

This commit is contained in:
Georg Reinke 2017-04-12 23:13:02 +02:00
parent c135451db7
commit 766097f83f
2 changed files with 5 additions and 4 deletions

View file

@ -147,7 +147,7 @@ int hook_cmp_priority(const void *a, const void *b)
int hook_parse_list(struct list *list, config_setting_t *cfg, struct path *o)
{
struct hook h;
struct hook h = {.state = STATE_DESTROYED};
struct plugin *p;
int ret, priority = 10;
@ -183,4 +183,4 @@ int hook_parse_list(struct list *list, config_setting_t *cfg, struct path *o)
}
return 0;
}
}

View file

@ -58,7 +58,8 @@ static void path_read(struct path *p)
if (enqueue != recv) {
info("Hooks skipped %u out of %u samples for path %s", recv - enqueue, recv, path_name(p));
stats_update(p->stats->delta, STATS_SKIPPED, recv - enqueue);
if (p->stats)
stats_update(p->stats->delta, STATS_SKIPPED, recv - enqueue);
}
/* Keep track of the lowest index that wasn't enqueued;
@ -452,7 +453,7 @@ int path_reverse(struct path *p, struct path *r)
for (size_t i = 0; i < list_length(&p->hooks); i++) {
struct hook *h = list_at(&p->hooks, i);
struct hook hc;
struct hook hc = {.state = STATE_DESTROYED};
ret = hook_init(&hc, h->_vt, p);
if (ret)