Skip to content

Commit

Permalink
Bugfix for host check (ntop#1097)
Browse files Browse the repository at this point in the history
this bug is from commit `427002d14` `2020-05-06 00:31:40`
  • Loading branch information
pengtianabc authored Dec 29, 2020
1 parent 84132c6 commit ab037e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4324,7 +4324,7 @@ int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_str, c
memset(&ac_pattern, 0, sizeof(ac_pattern));

if(ndpi_str->custom_categories.hostnames_shadow.ac_automa == NULL) {
free(name);
ndpi_free(name);
return(-1);
}

Expand All @@ -4333,12 +4333,12 @@ int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_str, c

rc = ac_automata_add(ndpi_str->custom_categories.hostnames_shadow.ac_automa, &ac_pattern);
if(rc != ACERR_DUPLICATE_PATTERN && rc != ACERR_SUCCESS) {
free(name);
ndpi_free(name);
return(-1);
}

if(rc == ACERR_DUPLICATE_PATTERN)
free(name);
ndpi_free(name);

return(0);
}
Expand Down

0 comments on commit ab037e2

Please sign in to comment.