]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: clear data pointer in bf_free
authorMark Stapp <mjs@voltanet.io>
Fri, 17 Apr 2020 20:53:37 +0000 (16:53 -0400)
committerMark Stapp <mjs@voltanet.io>
Fri, 17 Apr 2020 20:53:37 +0000 (16:53 -0400)
Help avoid double-free by clearing data pointer.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/bitfield.h

index eebfc049d9006838d04ace8bf4401669f1e19bb2..2d98760df756f451215cc264b9e1f7388ebe4b36 100644 (file)
@@ -154,6 +154,7 @@ typedef unsigned int word_t;
        do {                                                                   \
                if ((v).data) {                                                \
                        free((v).data);                                        \
+                       (v).data = NULL;                                       \
                }                                                              \
        } while (0)