Skip to content

Commit

Permalink
numademo: free test nodemask
Browse files Browse the repository at this point in the history
Free the test nodemasks after each test.

Fixes the following valgrind warnings:

  128 bytes in 1 blocks are indirectly lost in loss record 10 of 20
     at 0x4C2A975: calloc (vg_replace_malloc.c:711)
     by 0x4E37E84: numa_bitmask_alloc (libnuma.c:214)
     by 0x402CEB: test (in /home/sansharm/src/numactl/.libs/numademo)
     by 0x401661: main (in /home/sansharm/src/numactl/.libs/numademo)

  144 (16 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 11 of 20
     at 0x4C28BE3: malloc (vg_replace_malloc.c:299)
     by 0x4E37E65: numa_bitmask_alloc (libnuma.c:210)
     by 0x402A07: test (in /home/sansharm/src/numactl/.libs/numademo)
     by 0x401612: main (in /home/sansharm/src/numactl/.libs/numademo)

Signed-off-by:Sanskriti Sharma <sansharm@redhat.com>
  • Loading branch information
Sanskriti Sharma authored and andikleen committed Oct 15, 2018
1 parent 2451462 commit a7ec807
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion numademo.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ void test(enum test type)
printf("current interleave node %d\n", numa_get_interleave_node());
}

numa_bitmask_free(nodes);

numa_set_interleave_mask(numa_no_nodes_ptr);

nodes = numa_allocate_nodemask();
Expand Down Expand Up @@ -447,7 +449,7 @@ void test(enum test type)
if (!delim[0])
printf("\n\n\n");
}

numa_bitmask_free(nodes);
/* numa_run_on_node_mask is not tested */
}

Expand Down

0 comments on commit a7ec807

Please sign in to comment.