summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-11-01 16:01:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-11-01 16:01:37 (GMT)
commitb9d042d2d273cacff8ecfeecd5e1bd75a6da7f3b (patch)
tree846e6e81be5ccaa721d2c94ef98771de52b0f48b /src/H5FDdirect.c
parent51c5bf8aa76cf378ccd59b02247fb7cd0d9b3eaf (diff)
downloadhdf5-b9d042d2d273cacff8ecfeecd5e1bd75a6da7f3b.zip
hdf5-b9d042d2d273cacff8ecfeecd5e1bd75a6da7f3b.tar.gz
hdf5-b9d042d2d273cacff8ecfeecd5e1bd75a6da7f3b.tar.bz2
[svn-r22998] Description:
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 4721a44..9715bc1 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) {