diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-19 19:40:24 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-19 19:40:24 -0700 |
commit | fe4c305ba334956e70de9bbbb0292fac7404338a (patch) | |
tree | e63e5a28cb7a77b8c97309dc7033dc010ceeb941 /share | |
parent | 56a2b065aebd95a70d2e4d6a8500fff1d463e563 (diff) | |
download | txr-fe4c305ba334956e70de9bbbb0292fac7404338a.tar.gz txr-fe4c305ba334956e70de9bbbb0292fac7404338a.tar.bz2 txr-fe4c305ba334956e70de9bbbb0292fac7404338a.zip |
ffi: release return value when aborting callback.
Continuing on the topic of the previous commit, what if in a
callback an error occurs in the put operation that produces
the return value? In that case we end up clobbering with
the abort_retval or nulling out with zero bytes, either way
potentially leaking memory.
* ffi.c (ffi_closure_dispatch_safe): If the return value type
has release semantics, then as the very first thing, null out
the return value buffer. Then later if a dynamic control
transfer is intercepted, invoke the release semantics before
doing anything to the return value buffer.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions