]> git.ipfire.org Git - thirdparty/suricata.git/commit
conf: init parser after check with stat() 12005/head
authorZemeteri Kamimizu <zemeterisan@gmail.com>
Thu, 3 Oct 2024 09:50:31 +0000 (12:50 +0300)
committerVictor Julien <victor@inliniac.net>
Tue, 22 Oct 2024 11:03:06 +0000 (13:03 +0200)
commit4f80cb5f69eab91dbb58c5e8518abdf29f853b6c
tree0ccb3926a1df0d68d0fdef87513403ed17d6883c
parent1bf55502dcad69e14ab9fe2b35fd29a15ab19c89
conf: init parser after check with stat()

Commit changes are made to avoid possible memory leaks. If the parser
is initialized before configuration file checking, there was no deinit
call before function return. Do check config file existance and type
before YAML parser initialization, so we don't need to deinit parser
before exiting the function.

Bug: #7302
(cherry picked from commit 87e6e9374ff40847d3e7408afcd404374b629337)
src/conf-yaml-loader.c