forked from espressif/esp-protocols
committed by
suren-gabrielyan-espressif
parent
5252b1d801
commit
c8b0d5ea9d
@ -2315,6 +2315,7 @@ static mdns_service_t * _mdns_create_service(const char * service, const char *
|
||||
if (hostname) {
|
||||
s->hostname = strndup(hostname, MDNS_NAME_BUF_LEN - 1);
|
||||
if (!s->hostname) {
|
||||
free((char *)s->instance);
|
||||
free(s);
|
||||
return NULL;
|
||||
}
|
||||
@ -2324,12 +2325,14 @@ static mdns_service_t * _mdns_create_service(const char * service, const char *
|
||||
|
||||
s->service = strndup(service, MDNS_NAME_BUF_LEN - 1);
|
||||
if (!s->service) {
|
||||
free((char *)s->instance);
|
||||
free(s);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s->proto = strndup(proto, MDNS_NAME_BUF_LEN - 1);
|
||||
if (!s->proto) {
|
||||
free((char *)s->instance);
|
||||
free((char *)s->service);
|
||||
free(s);
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user