examples/pipeline: fix files for table update
authorCristian Dumitrescu <cristian.dumitrescu@intel.com>
Tue, 6 Oct 2020 20:37:50 +0000 (21:37 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 8 Oct 2020 13:09:28 +0000 (15:09 +0200)
Coverity issue: 362744, 362745, 362882
Fixes: 5074e1d551 ("examples/pipeline: add configuration commands")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
examples/pipeline/cli.c

index 9f3d87a..76a58ee 100644 (file)
@@ -836,8 +836,8 @@ cmd_pipeline_table_update(char **tokens,
        }
 
        if (strcmp(file_name_delete, "none")) {
-               file_add = fopen(file_name_delete, "r");
-               if (!file_add) {
+               file_delete = fopen(file_name_delete, "r");
+               if (!file_delete) {
                        snprintf(out, out_size, "Cannot open file %s",
                                file_name_delete);
                        goto error;
@@ -845,8 +845,8 @@ cmd_pipeline_table_update(char **tokens,
        }
 
        if (strcmp(file_name_default, "none")) {
-               file_add = fopen(file_name_default, "r");
-               if (!file_add) {
+               file_default = fopen(file_name_default, "r");
+               if (!file_default) {
                        snprintf(out, out_size, "Cannot open file %s",
                                file_name_default);
                        goto error;