From 6a53c14240872fcc82504fffaa010d754a8c73e0 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 13:47:27 -0500 Subject: Add HDfree of vector, matrix_out and matrix_out1 previously HDmalloced in coll_write_test(). --- testpar/t_span_tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 20bc4ac..f4de133 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -255,7 +255,7 @@ void coll_write_test(int chunk_factor) #endif - int *matrix_out, *matrix_out1, *vector; + int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL; int mpi_size,mpi_rank; @@ -662,6 +662,13 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); + if (vector != NULL) + HDfree(vector); + if (matrix_out != NULL) + HDfree(matrix_out); + if (matrix_out1 != NULL) + HDfree(matrix_out1); + return ; } -- cgit v0.12 From 5d7c18fcfc14a53f4d6321460463357fbda61f4b Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 12 Mar 2018 14:10:59 -0500 Subject: Remove comparison to NULL for variables to be freed. --- testpar/t_span_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index f4de133..3c836ad 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -662,11 +662,11 @@ void coll_write_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); - if (vector != NULL) + if (vector) HDfree(vector); - if (matrix_out != NULL) + if (matrix_out) HDfree(matrix_out); - if (matrix_out1 != NULL) + if (matrix_out1) HDfree(matrix_out1); return ; -- cgit v0.12