diff options
author | Milan Crha <mcrha@redhat.com> | 2022-10-10 09:38:55 +0200 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2022-10-10 09:38:55 +0200 |
commit | 7982ed911c3cf8dd2ca2a852174f64a90a428837 (patch) | |
tree | 511319f4831bd6da7106c06bcc64901a99f316bf /libsoup/soup-session.c | |
parent | a948ac11b143d5db832749fdb19113fff6b614c1 (diff) | |
download | libsoup-7982ed911c3cf8dd2ca2a852174f64a90a428837.tar.gz |
soup-session: Fix memory free of reversed GList
The g_list_reverse() modifies the `items` in a way, which can mean
the later call of `g_list_free (items);` frees only the last item,
not all of the items.
Diffstat (limited to 'libsoup/soup-session.c')
-rw-r--r-- | libsoup/soup-session.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c index e3577428..de0da49c 100644 --- a/libsoup/soup-session.c +++ b/libsoup/soup-session.c @@ -1824,7 +1824,9 @@ async_run_queue (SoupSession *session) g_queue_foreach (priv->queue, (GFunc)collect_queue_item, &items); g_mutex_unlock (&priv->queue_mutex); - for (i = g_list_reverse (items); i != NULL; i = g_list_next (i)) { + items = g_list_reverse (items); + + for (i = items; i != NULL; i = g_list_next (i)) { SoupMessageQueueItem *item = (SoupMessageQueueItem *)i->data; soup_session_process_queue_item (item->session, item, TRUE); } |