Merge in SNORT/snort3 from ~OSHUMEIK/snort3:nullptr_check to master
Squashed commit of the following:
commit
56fd2e82203634e775a3aea7c31f8643a7256665
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date: Wed Feb 23 12:46:28 2022 +0200
utils: check for NULL before calling fclose()
}
else
{
- fclose(pid_lockfile);
+ if (pid_lockfile)
+ {
+ fclose(pid_lockfile);
+ pid_lockfile = nullptr;
+ }
const char* error = get_error(errno);
ErrorMessage("Failed to create pid file %s, Error: %s\n",
sc->pid_filename.c_str(), error);