diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2021-09-29 20:45:34 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2021-10-19 14:55:39 +0200 |
| commit | 4a1b3289c7a8abc9858bfd1ac2ced35e8d20dd68 (patch) | |
| tree | c3e1b4ab2a18283eb88418a07f9e08ec35453d69 /lib/typerb.c | |
| parent | 9de36e51fee47cf4ce31df420940af6a51528d8b (diff) | |
lib: null out deleted pointers in typesafe containers
Some of the typesafe containers didn't null out their innards of items
after an item was deleted or popped off the container. This is both a
bit unsafe as well as hinders the upcoming _member() from working
efficiently.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/typerb.c')
| -rw-r--r-- | lib/typerb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/typerb.c b/lib/typerb.c index 092faa4cc9..151d91ce20 100644 --- a/lib/typerb.c +++ b/lib/typerb.c @@ -45,6 +45,7 @@ #include "config.h" #endif +#include <string.h> #include "typerb.h" #define RB_BLACK 0 @@ -330,6 +331,7 @@ color: rbe_remove_color(rbt, parent, child); rbt->count--; + memset(old, 0, sizeof(*old)); return (old); } |
