]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Replace realloc with new gc_realloc function
authorArne Schwabe <arne@rfc2549.org>
Tue, 27 Dec 2022 14:02:45 +0000 (15:02 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 27 Dec 2022 19:07:42 +0000 (20:07 +0100)
commit09267c1ccde6a8f0671c785413ca847e97bbc0a5
tree199df230aeaf05eb6089d6e10838dbd0fa0076f4
parentf5919a42e4a6772c4116d19cd09132bedb6d77f5
Replace realloc with new gc_realloc function

The realloc logic has the problem that it relies on the memory being
deallocated by uninit_options rather than by freeing the gc. This
does not always happen in all code path. Especially the crypto selftest
run by make check will not call uninit_options.

This introduces a gc_realloc function that ensures that the pointer is
instead freed when gc_free is called.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20221227140249.3524943-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25829.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit e7f2169772f90f9bf158a17f5656a6a985e74e31)
src/openvpn/buffer.c
src/openvpn/buffer.h
src/openvpn/options.c
tests/unit_tests/openvpn/test_buffer.c