..in a VERY uncommon/rare case.
}
else /* ancient and no values -> waste of memory */
{
- keys = (char **) realloc ((void *) keys,
+ char **tmp = (char **) realloc ((void *) keys,
(keys_num + 1) * sizeof (char *));
- if (keys == NULL)
+ if (tmp == NULL)
{
char errbuf[1024];
ERROR ("rrdtool plugin: "
sstrerror (errno, errbuf,
sizeof (errbuf)));
c_avl_iterator_destroy (iter);
+ sfree (keys);
return;
}
+ keys = tmp;
keys[keys_num] = key;
keys_num++;
}
keys[i] = NULL;
} /* for (i = 0..keys_num) */
- free (keys);
+ sfree (keys);
cache_flush_last = now;
} /* void rrd_cache_flush */