aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-08 17:14:44 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:01 +0100
commita470ed5d4d3fc80661b46b8b964077265b8706a6 (patch)
treeb693423f131650a2c49a9d403a68d32b8a18c818
parent59df05a16fb0c221905438d7ab3d2dcd9ec81908 (diff)
Fix potential memory leaks
-rw-r--r--src/hdf5-file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c
index 485e7fb0..bcd51f99 100644
--- a/src/hdf5-file.c
+++ b/src/hdf5-file.c
@@ -406,6 +406,7 @@ int hdf5_read(struct hdfile *f, struct image *image, int satcorr)
H5P_DEFAULT, buf);
if ( r < 0 ) {
ERROR("Couldn't read data\n");
+ free(buf);
return 1;
}
image->data = buf;
@@ -420,6 +421,7 @@ int hdf5_read(struct hdfile *f, struct image *image, int satcorr)
H5P_DEFAULT, flags);
if ( r < 0 ) {
ERROR("Couldn't read flags\n");
+ free(flags);
image->flags = NULL;
} else {
image->flags = flags;