mirror of
https://github.com/ostreedev/ostree.git
synced 2024-10-27 01:55:35 +03:00
fetcher/curl: Fix leaks caught by ASAN
I had to rebuild `glib` with `-fsanitize=address` in order to get a stack trace to finally get this one. However, *installing* that glib "system wide" in my container breaks everything (including `rpm-ostree`, `dnf`, `pkg-config` etc.) that wasn't built with ASAN. So my test scenario right now is to extract the libs and do e.g.: ``` make && env LD_LIBRARY_PATH=$HOME/src/distgit/fedora/glib2/asan-libs make check TESTS=tests/test-basic.sh ``` Closes: #719 Approved by: jlebon
This commit is contained in:
parent
f667a82fc1
commit
72336f1c48
@ -416,11 +416,13 @@ timer_cb (gpointer data)
|
||||
{
|
||||
OstreeFetcher *fetcher = data;
|
||||
CURLMcode rc;
|
||||
GSource *orig_src = fetcher->timer_event;
|
||||
|
||||
fetcher->timer_event = NULL;
|
||||
rc = curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running);
|
||||
g_assert (rc == CURLM_OK);
|
||||
check_multi_info (fetcher);
|
||||
if (fetcher->timer_event == orig_src)
|
||||
fetcher->timer_event = NULL;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -713,6 +715,8 @@ initiate_next_curl_request (FetcherRequest *req,
|
||||
CURLMcode rc;
|
||||
OstreeFetcher *self = req->fetcher;
|
||||
|
||||
if (req->easy)
|
||||
curl_easy_cleanup (req->easy);
|
||||
req->easy = curl_easy_init ();
|
||||
g_assert (req->easy);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user