summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-02-09 22:14:46 +0100
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-02-09 22:14:46 +0100
commitecf82aa41e76ecfbaf3f5762af1e90ebc9263721 (patch)
treeefe0817e9eef05e12a19ff479602e7ee8349c546
parentlib: Release memory of YANG translation module on error (diff)
downloadfrr-ecf82aa41e76ecfbaf3f5762af1e90ebc9263721.tar.xz
frr-ecf82aa41e76ecfbaf3f5762af1e90ebc9263721.zip
lib: Free dnode before returning if YANG translator model is already loaded
Seems just a missed one because at `goto error` we release dnode. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--lib/yang_translator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/yang_translator.c b/lib/yang_translator.c
index f37084f0d..de5dc4d43 100644
--- a/lib/yang_translator.c
+++ b/lib/yang_translator.c
@@ -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;
}