diff options
author | Philip Withnall <withnall@endlessm.com> | 2018-05-22 12:14:22 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-25 13:12:33 +0000 |
commit | fc10354404123d76910bb7eca4d6bae8d9f58da3 (patch) | |
tree | 88cc9c00d7000d704c804af6bdfb56c9416c1795 | |
parent | 66777b1b7593fc0d15cfb0b5ffb433a9b622f96d (diff) | |
download | ostree-fc10354404123d76910bb7eca4d6bae8d9f58da3.tar.gz |
lib/repo-pull: Factor out free function for FetchDeltaSuperData
This introduces no functional changes, but does make the code a little
cleaner.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1599
Approved by: jlebon
-rw-r--r-- | src/libostree/ostree-repo-pull.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 3ce5cea7..00b161f6 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -2462,6 +2462,16 @@ typedef struct { } FetchDeltaSuperData; static void +fetch_delta_super_data_free (FetchDeltaSuperData *fetch_data) +{ + g_free (fetch_data->from_revision); + g_free (fetch_data->to_revision); + if (fetch_data->requested_ref) + ostree_collection_ref_free (fetch_data->requested_ref); + g_free (fetch_data); +} + +static void set_required_deltas_error (GError **error, const char *from_revision, const char *to_revision) @@ -2541,15 +2551,12 @@ on_superblock_fetched (GObject *src, } out: - g_free (fdata->from_revision); - g_free (fdata->to_revision); - if (fdata->requested_ref) - ostree_collection_ref_free (fdata->requested_ref); - g_free (fdata); g_assert (pull_data->n_outstanding_metadata_fetches > 0); pull_data->n_outstanding_metadata_fetches--; pull_data->n_fetched_metadata++; check_outstanding_requests_handle_error (pull_data, &local_error); + + g_clear_pointer (&fetch_data, fetch_delta_super_data_free); } static gboolean |