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 /src/partial_sim.c | |
parent | 50cf52b0bc0baa683b9508568131a3f6281bf4ff (diff) |
Add missing cleanup on error paths
Diffstat (limited to 'src/partial_sim.c')
-rw-r--r-- | src/partial_sim.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c index 63851b9c..efba8ebd 100644 --- a/src/partial_sim.c +++ b/src/partial_sim.c @@ -349,11 +349,13 @@ static void *create_job(void *vqargs) STREAM_REFLECTIONS); if ( image == NULL ) { ERROR("Failed to read template chunk!\n"); + free(wargs); return NULL; } if ( image->n_crystals != 1 ) { ERROR("Template stream must have exactly one crystal " "per frame.\n"); + free(wargs); return NULL; } @@ -947,6 +949,7 @@ int main(int argc, char *argv[]) if ( fh == NULL ) { ERROR("Failed to open /dev/urandom. Try again without" " --really-random.\n"); + free(qargs.rngs); return 1; } |