Skip to content

Commit

Permalink
mdns: Fix more windows bugs
Browse files Browse the repository at this point in the history
Handle cleanup properly on an error.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Jul 19, 2023
1 parent 3e1d3cc commit f9e4b8a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,8 +1294,10 @@ gensio_mdnslib_free_service(struct gensio_os_funcs *o, struct gensio_mdns_servic
}
o->free(o, values);
}
o->free(o, s->win_name);
o->free(o, s->win_host);
if (s->win_name)
o->free(o, s->win_name);
if (s->win_host)
o->free(o, s->win_host);
}

static void
Expand Down Expand Up @@ -1371,7 +1373,8 @@ free_service(struct gensio_os_funcs *o, struct gensio_mdns_service *s)
{
struct gensio_mdns *m = s->m;

gensio_list_rm(&m->services, &s->link);
if (s->link.list)
gensio_list_rm(&m->services, &s->link);
gensio_mdnslib_free_service(o, s);
if (s->currname)
gensio_cntstr_free(o, s->currname);
Expand Down

0 comments on commit f9e4b8a

Please sign in to comment.