Commit graph

7 commits

Author SHA1 Message Date
Christian Hopps b7db6b2675 lib: darr: add ability to set MTYPE for dynamic arrays
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps f3d6edc7ee lib: darr: add new access and str functions
- darr_last(), and darr_strdup_cap().
- strcat, strdup, strlen, strnul equivs.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps a6c8e08ecd lib: darr needs to use memory.h for both alloc and free
Was using XREALLOC() and then free(). instant "memleaks".

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-11 20:30:02 +01:00
Donatas Abraitis 4d087a71d3
Merge pull request #14508 from LabNConsulting/chopps/darr-use-frrmemfunc
lib: use XREALLOC over realloc avoid coverity warning
2023-10-03 10:34:27 +03:00
Donatas Abraitis 02d8b80ce4 *: Do not cast to the same type as the destination is
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-29 10:24:16 +03:00
Christian Hopps 53511f252d lib: use XREALLOC over realloc avoid coverity warning
I believe coverity is complaining that the current code does not handle the
realloc fail case, in which case the original pointer is not freed, but NULL is
returned. The code assert()s it's not failed but that is not strong enough it
needs to abort which XREALLOC does and is a better integration into FRR-inrfa
anyway.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-09-29 01:19:53 -04:00
Christian Hopps e6e0c5bd25 lib: add dynamic array type
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-27 18:00:56 -04:00