Clear pid-vector, to avoid spurious track selection
Change-Id: Ibc293aa1305126920c0b2c44df1f7a7d5ae9ea9d
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/tools/g2/events.c b/src/tools/g2/events.c
index d4333bb..6839a43 100644
--- a/src/tools/g2/events.c
+++ b/src/tools/g2/events.c
@@ -142,7 +142,7 @@
pid_sort_t *psp;
int i;
- psp = g_pids = g_malloc(sizeof(pid_sort_t)*g_npids);
+ psp = g_pids = g_malloc0(sizeof(pid_sort_t)*g_npids);
for (i = 0; i < PIDHASH_NBUCKETS; i++) {
pp = s_pidhash[i];
@@ -191,7 +191,7 @@
* toggle between "chase" mode, snapshots, and the original
* display method on short notice
*/
- g_original_pids = g_malloc(sizeof(pid_sort_t)*g_npids);
+ g_original_pids = g_malloc0(sizeof(pid_sort_t)*g_npids);
memcpy (g_original_pids, g_pids, sizeof(pid_sort_t)*g_npids);
}
diff --git a/src/tools/g2/view1.c b/src/tools/g2/view1.c
index c524c81..c5f799d 100644
--- a/src/tools/g2/view1.c
+++ b/src/tools/g2/view1.c
@@ -998,7 +998,7 @@
found:
pid_index = i + vp->first_pid_index;
- new_pidvec = g_malloc(sizeof(pid_sort_t)*g_npids);
+ new_pidvec = g_malloc0(sizeof(pid_sort_t)*g_npids);
pold = g_pids;
pnew = new_pidvec;
@@ -1743,7 +1743,7 @@
datum_to_chase = ep->datum;
pid_to_chase = ep->pid->pid_value;
pids_mapped = 0;
- new_pidvec = g_malloc(sizeof(pid_sort_t)*g_npids);
+ new_pidvec = g_malloc0(sizeof(pid_sort_t)*g_npids);
while (1) {
if (srch_chase_dir == SRCH_CHASE_FORWARD) {