lib: Change ADD_TO_ARRAY to use a tmp variable
commitab41b3612aa10af5c46f14dff3dee8581fbe8607
authorVolker Lendecke <vl@samba.org>
Mon, 30 Sep 2024 08:43:00 +0000 (30 10:43 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 2 Oct 2024 13:12:30 +0000 (2 13:12 +0000)
treec64904643148b6cc6dcdfc6078997d40f13e31a8
parentd03096721e2b86d7f736bd57b2d0f147ccb1e3fc
lib: Change ADD_TO_ARRAY to use a tmp variable

This should fix a few Coverity Resource Leak findings. Coverity does
not understand that SMB_ASSERT aborts the program, so it believes if
realloc fails we leak the previous allocation. Those are false
positives, but doing it this way does not cost much.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/include/smb_macros.h