diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2020-10-27 11:58:14 -0400 |
---|---|---|
committer | Jonathan Lebon <jonathan@jlebon.com> | 2020-10-27 12:01:01 -0400 |
commit | 8717608c7e2edc998f370bac8912837a9f15c4b3 (patch) | |
tree | 5877feb1db0a4186c0be43c1267953c8af2d4e15 /src/libostree/ostree-fetcher-curl.c | |
parent | 40edc33ef3dc623c7ef699b4065fd38614f68910 (diff) | |
download | ostree-8717608c7e2edc998f370bac8912837a9f15c4b3.tar.gz |
lib/fetch-curl: Unref timeout source
The timeout timer should always be one-shot, so let's just always
destroy it in the callback. The main context has its own ref on it, so
it won't be freed behind its back.
This *should* fix a leak that was brought up in
https://bugzilla.redhat.com/show_bug.cgi?id=1891761.
Reported-by: Milan Crha <mcrha@redhat.com>
Diffstat (limited to 'src/libostree/ostree-fetcher-curl.c')
-rw-r--r-- | src/libostree/ostree-fetcher-curl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index 178cb5cd..d6534b46 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -426,12 +426,9 @@ static gboolean timer_cb (gpointer data) { OstreeFetcher *fetcher = data; - GSource *orig_src = fetcher->timer_event; - + g_clear_pointer (&fetcher->timer_event, (GDestroyNotify)destroy_and_unref_source); (void)curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running); check_multi_info (fetcher); - if (fetcher->timer_event == orig_src) - fetcher->timer_event = NULL; return G_SOURCE_REMOVE; } |