summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2021-06-16 20:45:26 (GMT)
committerGitHub <noreply@github.com>2021-06-16 20:45:26 (GMT)
commitbb7dfbebdcaf3a838d03167a309b9934b997ce92 (patch)
treeabd9e0690ace1a47cc8c6a7e73c49281d38483c3 /test/h5test.c
parente4e9bb70db3ee275977caad4b494021af41619d7 (diff)
downloadhdf5-bb7dfbebdcaf3a838d03167a309b9934b997ce92.zip
hdf5-bb7dfbebdcaf3a838d03167a309b9934b997ce92.tar.gz
hdf5-bb7dfbebdcaf3a838d03167a309b9934b997ce92.tar.bz2
Fix several warnings (#747)
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 2a54982..4dff00d 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1195,9 +1195,10 @@ h5_set_info_object(void)
valp++;
/* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = (char *)HDcalloc(1, len + 1);
+ len = strcspn(valp, ";");
+ next = &valp[len];
+ if (NULL == (key_val = (char *)HDcalloc(1, len + 1)))
+ return -1;
/* increment the next pointer past the terminating semicolon */
if (*next == ';')
@@ -1593,6 +1594,9 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name)
void * buf = NULL; /* Buffer for copying data */
const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */
+ if (!filename)
+ goto error;
+
/* Allocate copy buffer */
if (NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE)))
goto error;