Comment 7 for bug 1792745

Revision history for this message
Anders Kaseorg (andersk) wrote :

It seems suspicious that cb_data->concheck.curl_ehandle is cleaned up here despite the comment a few lines above warning that it’s unsafe to do so.

https://github.com/NetworkManager/NetworkManager/blob/1.12.2/src/nm-connectivity.c#L190-L213

  /* Contrary to what cURL manual claim it is *not* safe to remove
   * the easy handle "at any moment"; specifically not from the
   * write function. Thus here we just dissociate the cb_data from
   * the easy handle and the easy handle will be cleaned up when the
   * message goes to CURLMSG_DONE in _con_curl_check_connectivity(). */

  curl_multi_remove_handle (priv->concheck.curl_mhandle, cb_data->concheck.curl_ehandle);
  curl_easy_cleanup (cb_data->concheck.curl_ehandle);

This cleanup call was added in https://github.com/NetworkManager/NetworkManager/pull/70. The comment was moved by that PR but was present before.