From 9d54a8361d07213b6201f3466e790b1aa4be07d7 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 23 Oct 2018 13:53:13 +0200 Subject: [PATCH] yaml: fix potential memleak and suppress coverity issue --- src/conf-yaml-loader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index e6a4be30b0..7599c1f1db 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -418,10 +418,12 @@ ConfYamlLoadFile(const char *filename) if (stat_buf.st_mode & S_IFDIR) { SCLogError(SC_ERR_FATAL, "yaml argument is not a file but a directory: %s. " "Please specify the yaml file in your -c option.", filename); + yaml_parser_delete(&parser); return -1; } } + // coverity[toctou : FALSE] infile = fopen(filename, "r"); if (infile == NULL) { SCLogError(SC_ERR_FATAL, "failed to open file: %s: %s", filename,