Skip to content

Commit

Permalink
Fix github issue #14321
Browse files Browse the repository at this point in the history
  • Loading branch information
mykrupp committed Feb 2, 2022
1 parent 1ae483d commit 0500f4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ static void HandleNodeIdResolve(void * context, DnssdService * result, CHIP_ERRO
#endif
proxy->OnNodeIdResolved(nodeData);
proxy->Release();

// Allocated in OnDnsResolveResult(), must be freed here
free(result);
}

static void HandleNodeBrowse(void * context, DnssdService * services, size_t servicesSize, CHIP_ERROR error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2317,10 +2317,13 @@ void GenericThreadStackManagerImpl_OpenThread<ImplClass>::OnDnsResolveResult(otE

error = FromOtDnsResponseToMdnsData(serviceInfo, type, dnsResult->mMdnsService, dnsResult->mServiceTxtEntry);

VerifyOrExit(error == CHIP_NO_ERROR, );

DeviceLayer::PlatformMgr().ScheduleWork(DispatchResolve, reinterpret_cast<intptr_t>(dnsResult));

exit:

dnsResult->error = error;
DeviceLayer::PlatformMgr().ScheduleWork(DispatchResolve, reinterpret_cast<intptr_t>(dnsResult));
}

template <class ImplClass>
Expand Down

0 comments on commit 0500f4c

Please sign in to comment.