[esnacc-dev] [PATCH] cxx-lib/src: corrected usage of 'delete' causing uncleared memory.

Aaron Conole aconole at redhat.com
Mon Jun 24 13:03:59 UTC 2019

Aaron Conole <aconole at bytheb.org> writes:

> From: Jan Sperber <jan.sperber at hytera.de>
> From: Jan Sperber <jan.sperber at hytera.de>
> 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
> Reported-at: https://github.com/esnacc/esnacc-ng/pull/49
> Fixes: f245889884a7 ("cxx/asn-int: fix integer encoding/decoding")
> Fixes: dce1e2a48583 ("Starting with eSnacc 1.7 as a base")
> Signed-off-by: Jan Sperber <jan.sperber at hytera.de>
> Signed-off-by: Aaron Conole <aconole at bytheb.org>
> ---

This patch is mostly fine for me.  I plan to make the following changes
on apply:

s/delete[]/delete []/

Also, I plan to add a change to AUTHORS to add Jan.

Thanks for your contribution!


More information about the dev mailing list