ews and http-con race condition?

  • Jochen De Smet
    Jochen De Smet

    sipe_ews_do_autodiscover does cal->http_conn = http_conn_create(…)

    sipe_connection_cleanup does sipe_cal_calendar_free(…) which does an http_conn_free(…) which does a g_free(http_conn)

    So if the connection attempt is still pending when sipe_connection_cleanup is called, http_conn will be freed and http_conn_connected will be called with a freed http_conn, causing a segfault when trying to check http_conn->host in http_conn_send0, (or http_conn_error will segfault accessing http_conn->callback)

    Should there be a call to http_conn_close in http_conn_free or something?