diff options
author | Thomas White <taw@physics.org> | 2021-07-21 11:51:56 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-07-21 15:34:31 +0200 |
commit | 6d94d4115c254d344bbb927596a7141ef39fd298 (patch) | |
tree | 652d07c4d6a9521c9359aa13bbda27309f53e6f8 /libcrystfel/src/image-hdf5.c | |
parent | 50cf52b0bc0baa683b9508568131a3f6281bf4ff (diff) |
Add missing cleanup on error paths
Diffstat (limited to 'libcrystfel/src/image-hdf5.c')
-rw-r--r-- | libcrystfel/src/image-hdf5.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libcrystfel/src/image-hdf5.c b/libcrystfel/src/image-hdf5.c index 38ebf42b..9cad0a33 100644 --- a/libcrystfel/src/image-hdf5.c +++ b/libcrystfel/src/image-hdf5.c @@ -94,7 +94,10 @@ char **read_path_parts(const char *ev_orig, int *pn_plvals) } ev = strdup(ev_orig); - if ( ev == NULL ) return NULL; + if ( ev == NULL ) { + free(plvals); + return NULL; + } start = ev; do { @@ -166,7 +169,10 @@ int *read_dim_parts(const char *ev_orig, int *pn_dvals) } ev = strdup(ev+2); - if ( ev == NULL ) return NULL; + if ( ev == NULL ) { + free(dvals); + return NULL; + } start = ev; done = 0; |