]> git.puffer.fish Git - mirror/frr.git/commitdiff
mgmtd: fix crash on "show mgmtd datastore-contents" 14504/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 27 Sep 2023 10:22:01 +0000 (13:22 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 28 Sep 2023 13:07:18 +0000 (13:07 +0000)
When the command is called without specifying the datastore, it crashes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 7a8b1875c510e37d6a636fe52a02375f71ce8798)

mgmtd/mgmt_vty.c

index 44c6c0097ad6066bf29c55172223111f8ea6263b..b49bf80306c1bb14808dff10d26c7deea20b0938 100644 (file)
@@ -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);