Skip to content

Commit

Permalink
Merge pull request pi-hole#92 from pi-hole/fix/exit_on_memory_error
Browse files Browse the repository at this point in the history
Skip entry if pointer is invalid (allocation of memory failed)
  • Loading branch information
DL6ER authored Jun 19, 2017
2 parents 1912d32 + 69bbbf5 commit 60bf275
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,14 @@ int detectStatus(const char *domain)
{
// String duplication / memory allocation failed
logg("Notice: Memory allocation for part in detectStatus failed, domain: \"%s\"", domain);
continue;
}
char * partbuffer = calloc(strlen(part)+1, sizeof(char));
if(partbuffer == NULL)
{
// Memory allocation failed
logg("Notice: Memory allocation for partbuffer in detectStatus failed, domain: \"%s\"", domain);
continue;
}

// Strip subdomains one after another and
Expand Down

0 comments on commit 60bf275

Please sign in to comment.