summaryrefslogtreecommitdiffstats
path: root/tools/test/h5repack/h5repacktst.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-10-09 14:23:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-10-17 15:57:56 (GMT)
commit633b7f93ce6f2cca85c9930010fded235ff8eaa6 (patch)
treed97582532c8e190c8936ee83cd3d1bb8a2a53d07 /tools/test/h5repack/h5repacktst.c
parenta82aee9a5fb4b10951d95a0422a4125b18fe9a52 (diff)
downloadhdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.zip
hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.gz
hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.bz2
TRILAB-81 coverity fixes
Diffstat (limited to 'tools/test/h5repack/h5repacktst.c')
-rw-r--r--tools/test/h5repack/h5repacktst.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index f6166da..0ae570b 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -3728,7 +3728,7 @@ out:
H5Pclose(fcpl);
H5Fclose(fid);
} H5E_END_TRY;
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -3797,7 +3797,7 @@ out:
H5Pclose(fcpl);
H5Fclose(fid);
} H5E_END_TRY;
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -3838,7 +3838,7 @@ make_userblock_file(void)
out:
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -4134,13 +4134,19 @@ int write_dset_in(hid_t loc_id,
}
/* create a type larger than TEST_BUFSIZE */
- if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0)
+ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) {
+ HDfree(dbuf);
goto out;
+ }
size = H5Tget_size(tid);
- if ((sid = H5Screate_simple(1, sdims, NULL)) < 0)
+ if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) {
+ HDfree(dbuf);
goto out;
- if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ }
+ if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ HDfree(dbuf);
goto out;
+ }
#if defined(WRITE_ARRAY)
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
#endif
@@ -4149,7 +4155,7 @@ int write_dset_in(hid_t loc_id,
H5Dclose(did);
H5Tclose(tid);
H5Sclose(sid);
- HDfree( dbuf );
+ HDfree(dbuf);
}
/*-------------------------------------------------------------------------