Hi,
On 22/07/18 17:53, Steffan Karger wrote:
>>> + uint8_t *dst_data = buf_write_alloc(dst, data_read_len);
>>> + if (!dst_data)
>>> + {
>>> + dmsg(D_CRYPT_ERRORS, "%s: dst too small (%i, needs %li)", __func__,
>>> + BCAP(dst), data_read_len);
>>> + goto cleanup;
>>
>> Am I wrong or we are leaking dst_data in case of failure? or are we
>> assuming that this memory is now owned by dst and therefore its owner
>> (the caller) will take care of this?
>
> I don't think this leaks data; buf_write_alloc returns NULL if there is
> not enough space available in dst, and won't change dst in that case.
> So nothing to clean up in that case?
> Right. The name *_alloc() fooled me, but actually there is nothing being allocated here so nothing to clean up. Cheers, -- Antonio Quartulli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
