Skip to content

Commit 1d42fa3

Browse files
committed
dns-sd: Move dnssd_free_discovery_data() to dns_sd.c
There is no need to have one version per implementation. Signed-off-by: Paul Cercueil <[email protected]>
1 parent c32fab4 commit 1d42fa3

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

dns_sd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
#define close(s) closesocket(s)
3333
#endif
3434

35+
static void dnssd_free_discovery_data(struct dns_sd_discovery_data *d)
36+
{
37+
free(d->hostname);
38+
free(d->address);
39+
free(d);
40+
}
41+
3542
/* Some functions for handling common linked list operations */
3643
static void dnssd_remove_node(struct dns_sd_discovery_data **ddata, int n)
3744
{

dns_sd.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ int create_socket(const struct addrinfo *addrinfo);
6262
/* Resolves all IIO hosts on the available networks, and passes back a linked list */
6363
int dnssd_find_hosts(struct dns_sd_discovery_data ** ddata);
6464

65-
/* Frees memory of one entry on the list */
66-
void dnssd_free_discovery_data(struct dns_sd_discovery_data *d);
67-
6865
/* Deallocates complete list of discovery data */
6966
void dnssd_free_all_discovery_data(struct dns_sd_discovery_data *d);
7067

dns_sd_avahi.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ static int new_discovery_data(struct dns_sd_discovery_data **data)
5151
return 0;
5252
}
5353

54-
void dnssd_free_discovery_data(struct dns_sd_discovery_data *d)
55-
{
56-
free(d->hostname);
57-
free(d->address);
58-
free(d);
59-
}
60-
6154
static void avahi_process_resolved(struct dns_sd_discovery_data *ddata, const AvahiAddress *addr,
6255
const char *host_name, const uint16_t port)
6356
{

dns_sd_bonjour.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ static int new_discovery_data(struct dns_sd_discovery_data **data)
3232
return 0;
3333
}
3434

35-
void dnssd_free_discovery_data(struct dns_sd_discovery_data *d)
36-
{
37-
free(d->hostname);
38-
free(d);
39-
}
40-
4135
static void __cfnet_browser_cb (
4236
CFNetServiceBrowserRef browser,
4337
CFOptionFlags flags,

dns_sd_windows.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ static int new_discovery_data(struct dns_sd_discovery_data** data)
3131
return 0;
3232
}
3333

34-
void dnssd_free_discovery_data(struct dns_sd_discovery_data* d)
35-
{
36-
free(d->hostname);
37-
free(d);
38-
}
39-
4034
static int
4135
open_client_sockets(int* sockets, int max_sockets) {
4236
// When sending, each socket can only send to one network interface

0 commit comments

Comments
 (0)