]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Keychain.c was using free 15060/head
authorDonald Sharp <sharpd@nvidia.com>
Thu, 21 Dec 2023 22:01:56 +0000 (17:01 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 21 Dec 2023 22:01:56 +0000 (17:01 -0500)
This is a bit of a bummer that this slipped through
for so long.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/keychain.c

index f4df71b7e921c0c49ac51acb87b38a7a4c5f411e..5ff0d1e43e9d7e5a6d188af6662a30fa6b70060d 100644 (file)
@@ -37,6 +37,7 @@ static void keychain_free(struct keychain *keychain)
 static struct key *key_new(void)
 {
        struct key *key = XCALLOC(MTYPE_KEY, sizeof(struct key));
+
        QOBJ_REG(key, key);
        return key;
 }
@@ -77,7 +78,7 @@ static int key_cmp_func(void *arg1, void *arg2)
 static void key_delete_func(struct key *key)
 {
        if (key->string)
-               free(key->string);
+               XFREE(MTYPE_KEY, key->string);
        key_free(key);
 }