summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-static-delta-compilation.c
diff options
context:
space:
mode:
authorJonathan Lebon <jonathan@jlebon.com>2018-07-25 17:49:12 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-26 21:01:19 +0000
commitfcd31a195be0e48709ff44b24ed3b5dc2f4f60e3 (patch)
tree3503f38f0d7179580ab13a3de6171cdb5305b85c /src/libostree/ostree-repo-static-delta-compilation.c
parent9482922e5e813290ee9952a55f2b574bb61b1ef6 (diff)
downloadostree-fcd31a195be0e48709ff44b24ed3b5dc2f4f60e3.tar.gz
lib: Fix some minor memory leaks
I initially was going to add a `G_DEFINE_AUTOPTR_CLEANUP_FUNC` for `FetchStaticDeltaData`, but it honestly didn't seem worth mucking around ownership everywhere and potentially getting it wrong. Discovered by Coverity. Closes: #1692 Approved by: cgwalters
Diffstat (limited to 'src/libostree/ostree-repo-static-delta-compilation.c')
-rw-r--r--src/libostree/ostree-repo-static-delta-compilation.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c
index 9084a72f..f06fad68 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -313,14 +313,13 @@ finish_part (OstreeStaticDeltaBuilder *builder, GError **error)
static OstreeStaticDeltaPartBuilder *
allocate_part (OstreeStaticDeltaBuilder *builder, GError **error)
{
- OstreeStaticDeltaPartBuilder *part = g_new0 (OstreeStaticDeltaPartBuilder, 1);
-
if (builder->parts->len > 0)
{
if (!finish_part (builder, error))
return NULL;
}
+ OstreeStaticDeltaPartBuilder *part = g_new0 (OstreeStaticDeltaPartBuilder, 1);
part->objects = g_ptr_array_new_with_free_func ((GDestroyNotify)g_variant_unref);
part->payload = g_string_new (NULL);
part->operations = g_string_new (NULL);