mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
pull: Fix leak of FetchObjectData in some cases
Closes: #333 Approved by: giuseppe
This commit is contained in:
parent
bd4e250e93
commit
785f894de1
@ -809,6 +809,7 @@ meta_fetch_on_complete (GObject *object,
|
||||
GError *local_error = NULL;
|
||||
GError **error = &local_error;
|
||||
glnx_fd_close int fd = -1;
|
||||
gboolean free_fetch_data = FALSE;
|
||||
|
||||
ostree_object_name_deserialize (fetch_data->object, &checksum, &objtype);
|
||||
checksum_obj = ostree_object_to_string (checksum, objtype);
|
||||
@ -874,6 +875,8 @@ meta_fetch_on_complete (GObject *object,
|
||||
|
||||
if (!fetch_data->object_is_stored)
|
||||
enqueue_one_object_request (pull_data, checksum, objtype, FALSE, FALSE);
|
||||
|
||||
free_fetch_data = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -911,7 +914,7 @@ meta_fetch_on_complete (GObject *object,
|
||||
pull_data->n_outstanding_metadata_fetches--;
|
||||
pull_data->n_fetched_metadata++;
|
||||
check_outstanding_requests_handle_error (pull_data, local_error);
|
||||
if (local_error)
|
||||
if (local_error || free_fetch_data)
|
||||
{
|
||||
g_variant_unref (fetch_data->object);
|
||||
g_free (fetch_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user