summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-11-01 20:12:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-11-01 20:12:01 (GMT)
commita46c177ddfdb8578718eb3694811e634653c20de (patch)
tree219ff3377cd214ce9b282af02056651ca3df2611 /src/H5FDdirect.c
parent65597415a3faf5f68c5c638d6e65b45ce473b34b (diff)
downloadhdf5-a46c177ddfdb8578718eb3694811e634653c20de.zip
hdf5-a46c177ddfdb8578718eb3694811e634653c20de.tar.gz
hdf5-a46c177ddfdb8578718eb3694811e634653c20de.tar.bz2
[svn-r23000] Description:
Bring r22998 from trunk to 1.8 branch: Clean up warnings and bring changes from Coverity branch back to trunk: r20451: Fixed coverity 810 r20454: Purpose: Fix coverity issue 816 Description: Modified various file drivers to always check the return value from H5P_get_driver_info. r20455: Purpose: Cleanup fix for coverity issue 816 Description: Removed redundant check for "fa" in H5FD_core_open. Tested on: Mac OSX/64 10.8.2 (amazon) w/debug (Too minor to require h5committest)
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 941fb74..64ed8b6 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -533,7 +533,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* Get the driver specific information */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- fa = H5P_get_driver_info(plist);
+ if(NULL == (fa = (H5FD_direct_fapl_t *)H5P_get_driver_info(plist)))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
file->fd = fd;
H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t);
@@ -562,9 +563,9 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
* is to handle correctly the case that the file is in a different file system
* than the one where the program is running.
*/
- buf1 = (int*)HDmalloc(sizeof(int));
- if (HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
+ buf1 = (int *)HDmalloc(sizeof(int));
+ if(HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
if(o_flags & O_CREAT) {
if(write(file->fd, (void*)buf1, sizeof(int))<0) {