]> 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 17:31:53 +0000 (18:31 +0100)
commite7f2169772f90f9bf158a17f5656a6a985e74e31
tree15aecbe44408b01de9518643aa47aaa7a8f0f875
parent841524153fbdcd377065e221e91ef163d83b9cc9
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>
src/openvpn/buffer.c
src/openvpn/buffer.h
src/openvpn/options.c
tests/unit_tests/openvpn/test_buffer.c