From 39b6e03dc1570f0fd88acac06ef401d1bb08124b Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 27 Sep 2023 13:22:01 +0300 Subject: [PATCH] mgmtd: fix crash on "show mgmtd datastore-contents" When the command is called without specifying the datastore, it crashes. Signed-off-by: Igor Ryzhov (cherry picked from commit 7a8b1875c510e37d6a636fe52a02375f71ce8798) --- mgmtd/mgmt_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgmtd/mgmt_vty.c b/mgmtd/mgmt_vty.c index 44c6c0097ad6..b49bf80306c1 100644 --- a/mgmtd/mgmt_vty.c +++ b/mgmtd/mgmt_vty.c @@ -239,7 +239,7 @@ DEFPY(show_mgmt_dump_data, LYD_FORMAT format = fmt[0] == 'j' ? LYD_JSON : LYD_XML; FILE *f = NULL; - if (datastore) + if (dsname) datastore = mgmt_ds_name2id(dsname); ds_ctx = mgmt_ds_get_ctx_by_id(mm, datastore);