]> granicus.if.org Git - sysstat/commitdiff
tapestat: more fixes for realloc
authorPeter Schiffer <pschiffe@redhat.com>
Wed, 1 Jun 2016 11:34:51 +0000 (13:34 +0200)
committerPeter Schiffer <pschiffe@redhat.com>
Wed, 1 Jun 2016 11:34:51 +0000 (13:34 +0200)
Of course I forgot to assign new pointers from realloc to original variables.
This patch fixes that.

tapestat.c

index 534f3c3e48d9c0fc2ce985e6c44af51ee74cc3f5..7caf4fa55c2b21c0c759814307761eafcf118f8d 100644 (file)
@@ -224,6 +224,9 @@ void tape_check_tapes_and_realloc(void)
                        exit(4);
                }
 
+               tape_old_stats = tape_old_stats_t;
+               tape_new_stats = tape_new_stats_t;
+
                for (i = max_tape_drives; i < new_max_tape_drives; i++) {
                        tape_old_stats[i].valid = TAPE_STATS_INVALID;
                        tape_new_stats[i].valid = TAPE_STATS_INVALID;