esnacc / esnacc-ng

A continuation of the Enhanced SNACC ASN.1 compiler - See http://mail.esnacc.org/mailman/listinfo/dev
http://esnacc.org
GNU General Public License v2.0
32 stars 30 forks source link

cxx-lib/src: corrected usage of 'delete' causing uncleared memory. #49

Closed JanHyteraMobilfunk closed 5 years ago

JanHyteraMobilfunk commented 5 years ago

Hi! Working with libcxxasn1.so showed memory leakage. After analyzing the esnacc-ng sources we have seen several deletes have not been used correctly (helper tool cppcheck) and found that asn-int.cpp didn't deleted the allocated buffer at all. After further review I think there is no need to keep that buffer in memory so I added the delete statement at the end of the function Best regards, Jan

apconole commented 5 years ago

Good catch.

Can you please provide a sign-off line? Looks like this should also have tag:

Fixes: f245889884a7 ("cxx/asn-int: fix integer encoding/decoding")

JanHyteraMobilfunk commented 5 years ago

Morning, i have corrected the commit message.

apconole commented 5 years ago

Thanks for your contribution. Merged.