Skip to content

Commit

Permalink
Merge pull request FRRouting#14772 from LabNConsulting/fix-darr-memor…
Browse files Browse the repository at this point in the history
…y-acct
  • Loading branch information
idryzhov authored Nov 13, 2023
2 parents 8fb5596 + a6c8e08 commit 5dcd9f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/darr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "darr.h"
#include "memory.h"

DEFINE_MTYPE_STATIC(LIB, DARR, "Dynamic Array");
DEFINE_MTYPE(LIB, DARR, "Dynamic Array");

static uint _msb(uint count)
{
Expand Down
6 changes: 5 additions & 1 deletion lib/darr.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
* - DAs will never have capacity 0 unless they are NULL pointers.
*/
#include <zebra.h>
#include "memory.h"

DECLARE_MTYPE(DARR);

struct darr_metadata {
uint len;
Expand Down Expand Up @@ -111,7 +114,8 @@ void *__darr_resize(void *a, uint count, size_t esize);
#define darr_free(A) \
do { \
if ((A)) { \
free(_darr_meta(A)); \
void *__ptr = _darr_meta(A); \
XFREE(MTYPE_DARR, __ptr); \
(A) = NULL; \
} \
} while (0)
Expand Down

0 comments on commit 5dcd9f6

Please sign in to comment.