aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procps/top.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/procps/top.c b/procps/top.c
index 8fe53324f..5c41e8e10 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -979,6 +979,9 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval)
979 IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK) 979 IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK)
980 ) { 980 ) {
981 scan_mask ^= PSSCAN_TASKS; 981 scan_mask ^= PSSCAN_TASKS;
982 free(prev_hist);
983 prev_hist = NULL;
984 prev_hist_count = 0;
982 continue; 985 continue;
983 } 986 }
984# endif 987# endif
@@ -1000,10 +1003,10 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval)
1000# if ENABLE_FEATURE_TOPMEM 1003# if ENABLE_FEATURE_TOPMEM
1001 if (c == 's') { 1004 if (c == 's') {
1002 scan_mask = TOPMEM_MASK; 1005 scan_mask = TOPMEM_MASK;
1006 sort_field = (sort_field + 1) % NUM_SORT_FIELD;
1003 free(prev_hist); 1007 free(prev_hist);
1004 prev_hist = NULL; 1008 prev_hist = NULL;
1005 prev_hist_count = 0; 1009 prev_hist_count = 0;
1006 sort_field = (sort_field + 1) % NUM_SORT_FIELD;
1007 continue; 1010 continue;
1008 } 1011 }
1009# endif 1012# endif