summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
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) {