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>
This commit is contained in:
Donatas Abraitis 2023-02-09 23:14:46 +02:00
parent b9941b3fec
commit ecf82aa41e

View 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;
}