]> granicus.if.org Git - esp-idf/commit
netconn_gethostbyname: Fix race reporting success
authorJan Schmidt <jan@centricular.com>
Fri, 20 Jan 2017 03:17:03 +0000 (14:17 +1100)
committerAngus Gratton <angus@espressif.com>
Fri, 20 Jan 2017 03:57:00 +0000 (14:57 +1100)
commita14f22f65bf7bb69a4a11db22011cc1cd57e5ee4
treed38aeebe056491de4aed2b95aac2935cb69b1332
parentac412feb69abad798d6b989d23293d61092f6eaa
netconn_gethostbyname: Fix race reporting success

If the DNS request is dispatched and performed very quickly,
then it can complete before tcpip_callback() actually returns,
in which case we'll destroy the actual err_t error value passed
in the message. Use a local variable for the tcpip_callback
error code so that can't happen.

Resolves #269 https://github.com/espressif/esp-idf/pull/269
components/lwip/api/api_lib.c