]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Free dnode before returning if YANG translator model is already loaded 12784/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 9 Feb 2023 21:14:46 +0000 (23:14 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 10 Feb 2023 00:26:00 +0000 (00:26 +0000)
Seems just a missed one because at `goto error` we release dnode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ecf82aa41e76ecfbaf3f5762af1e90ebc9263721)

lib/yang_translator.c

index f37084f0d483fcf44307681db89404ccfd263172..de5dc4d43474f83387c9e5047671f2b58e115eb9 100644 (file)
@@ -165,6 +165,7 @@ struct yang_translator *yang_translator_load(const char *path)
                flog_warn(EC_LIB_YANG_TRANSLATOR_LOAD,
                          "%s: module translator \"%s\" is loaded already",
                          __func__, family);
+               yang_dnode_free(dnode);
                return NULL;
        }