aboutsummaryrefslogtreecommitdiff
path: root/src/hdf5-file.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-04 16:47:37 +0200
committerThomas White <taw@physics.org>2010-06-04 16:47:37 +0200
commitc802385878a7a1b094336e4517cc9f7071e44135 (patch)
tree6b27e0e943a0c3028c2e4da4a8c941443baf5134 /src/hdf5-file.c
parentb48699718c0626d3b58f576c82a0f31c47da07ec (diff)
Fix bailout path when reading pixel flags
Diffstat (limited to 'src/hdf5-file.c')
-rw-r--r--src/hdf5-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c
index 4272cbe6..aa341e50 100644
--- a/src/hdf5-file.c
+++ b/src/hdf5-file.c
@@ -341,6 +341,7 @@ int hdf5_read(struct hdfile *f, struct image *image)
mask_dh = H5Dopen(f->fh, "/processing/hitfinder/masks", H5P_DEFAULT);
if ( mask_dh <= 0 ) {
ERROR("Couldn't open flags\n");
+ image->flags = NULL;
} else {
flags = malloc(sizeof(uint16_t)*f->nx*f->ny);
r = H5Dread(mask_dh, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL,
@@ -351,8 +352,8 @@ int hdf5_read(struct hdfile *f, struct image *image)
} else {
image->flags = flags;
}
+ H5Dclose(mask_dh);
}
- H5Dclose(mask_dh);
/* Read wavelength from file */
image->lambda = get_wavelength(f);