Skip to content

Commit

Permalink
fix dummy mdns_list_interfaces
Browse files Browse the repository at this point in the history
In case multicast_if is a valid struct and not a void *. This can happen when
getifaddr headers are present but not the function.
  • Loading branch information
tguillem committed Oct 23, 2018
1 parent b9b10be commit f5a9f81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ mdns_list_interfaces(multicast_if** pp_intfs, size_t* p_nb_intf, int ai_family)
static size_t
mdns_list_interfaces(multicast_if** pp_intfs, size_t* p_nb_intf, int ai_family)
{
*pp_intfs = malloc(sizeof(**pp_intfs));
if (*pp_intfs == NULL)
multicast_if *intfs;
*pp_intfs = intfs = malloc(sizeof(*intfs));
if (intfs == NULL)
return (MDNS_ERROR);
**pp_intfs = NULL;
memset(intfs, 0, sizeof(*intfs));
*p_nb_intf = 1;
return (0);
}
Expand Down

0 comments on commit f5a9f81

Please sign in to comment.