]> git.puffer.fish Git - matthieu/frr.git/commitdiff
mgmtd: fix crash on "show mgmtd datastore-contents"
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 27 Sep 2023 10:22:01 +0000 (13:22 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 27 Sep 2023 10:22:01 +0000 (13:22 +0300)
When the command is called without specifying the datastore, it crashes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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);