Fix memory leak in zos_pl_forward
and add deallocation of tape signature to freeTapeResources
#84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes two changes:
double *signature
in the functionzos_pl_forward
inuni5_for.c
which caused problems due to allocation but missing deallocation of memory.freeTapeResources
intaping.c
which has previously been missing. This caused memory leaks when reusing tape IDs even when using the functionremoveTape
before creating the new tape.At a future point it would be very useful to add a note to the
README.md
which points out that the functionremoveTape
must be called before rewriting a tape reusing a tape ID in one execution.This workaround will prevent the aforementioned memory leak until ADOL-C adds the feature to automatically remove the tape before retaping in case the tape ID is reused. (Lot's of 'tape' in one sentence, hope it's clear what I mean)