Merge pull request #151 from ZeroMemoryEx/master

handle malloc failure
This commit is contained in:
Martin Lund 2022-07-04 17:44:20 +02:00 committed by GitHub
commit 44e99ffcb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -320,6 +320,11 @@ void config_file_parse(void)
int ret;
c = malloc(sizeof(struct config_t));
if (!c)
{
fprintf(stderr, "Error: Insufficient memory allocation");
exit(EXIT_FAILURE);
}
memset(c, 0, sizeof(struct config_t));
// Find config file