Buffer reallocation would fail for activities which are not in the file
being read. This is because @nr2 = -1 and @nr2 is used to compute the
memory to allocate in reallocate_all_buffers():
SREALLOC(a->buf[j], void,
(size_t) a->msize * nr_realloc * (size_t) a->nr2);
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
* not been collected in file (or if it has an unknown format).
*/
for (p = 0; p < NR_ACT; p++) {
- if (HAS_PERSISTENT_VALUES(act[p]->options)) {
- act[p]->nr_ini = file_hdr->sa_cpu_nr;
+ if (HAS_PERSISTENT_VALUES(act[p]->options) && (act[p]->nr_ini > 0)) {
if (act[p]->nr_ini > act[p]->nr_allocated) {
reallocate_all_buffers(act[p], act[p]->nr_ini);
}