summaryrefslogtreecommitdiffstats
path: root/test/fillval.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/fillval.c')
-rw-r--r--test/fillval.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/test/fillval.c b/test/fillval.c
index 019744a..72b8dcb 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1453,12 +1453,16 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
void *val_rd, *odd_val;
const void *init_val, *should_be, *even_val;
int val_rd_i, init_val_i = 9999;
- comp_vl_datatype init_val_c = {87, "baz", "mumble", 129};
+ comp_vl_datatype init_val_c = {87, NULL, NULL, 129};
comp_vl_datatype val_rd_c;
void *buf = NULL;
unsigned odd; /* Whether an odd or even coord. was read */
unsigned i, j; /* Local index variables */
+ /* Set vl datatype init value strings */
+ init_val_c.a = HDstrdup("baz");
+ init_val_c.b = HDstrdup("mumble");
+
/* Make copy of dataset creation property list */
if((dcpl = H5Pcopy(_dcpl)) < 0) TEST_ERROR
@@ -1802,8 +1806,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Release elements & memory buffer */
for(i = 0; i < nelmts; i++)
release_rtn((void *)((char *)buf + (val_size * i)));
+
+ HDfree(init_val_c.a);
+ HDfree(init_val_c.b);
HDfree(buf);
- buf = NULL;
/* Cleanup IDs */
if(H5Pclose(dcpl) < 0) TEST_ERROR
@@ -1813,8 +1819,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
return 0;
error:
- if(buf)
- HDfree(buf);
+ HDfree(init_val_c.a);
+ HDfree(init_val_c.b);
+ HDfree(buf);
+
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Dclose(dset);
@@ -1856,7 +1864,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
#else
int fillval_i = 0x4c70f1cd;
#endif
- comp_vl_datatype fillval_c = {32, "foo", "bar", 64}; /* Fill value for compound+vl datatype tests */
+ comp_vl_datatype fillval_c = {32, NULL, NULL, 64}; /* Fill value for compound+vl datatype tests */
char filename[1024];
/* Print testing message */
@@ -1865,6 +1873,10 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
else
TESTING("contiguous dataset extend")
+ /* Set vl datatype fill value strings */
+ fillval_c.a = HDstrdup("foo");
+ fillval_c.b = HDstrdup("bar");
+
/* Create dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
if(H5D_CHUNKED == layout)
@@ -1945,11 +1957,17 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pclose(dcpl) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
PASSED();
return 0;
error:
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
H5E_BEGIN_TRY {
H5Tclose(cmpd_vl_tid);
H5Pclose(dcpl);
@@ -1958,6 +1976,9 @@ error:
return 1;
skip:
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Fclose(file);