New upstream release
- d/patches: drop all patches, applied upstream
This commit is contained in:
parent
b76f46c53a
commit
2dd68bb7bf
|
|
@ -1,3 +1,10 @@
|
|||
ostree (2016.15-1) UNRELEASED; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
- d/patches: drop all patches, applied upstream
|
||||
|
||||
-- Simon McVittie <smcv@debian.org> Tue, 13 Dec 2016 13:01:18 +0000
|
||||
|
||||
ostree (2016.14-2) unstable; urgency=medium
|
||||
|
||||
* Make build-time test failures non-fatal, as long as at least
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 22:02:42 -0500
|
||||
Subject: [ASAN] bootconfig: Drop a pointless strdup in parser
|
||||
|
||||
Not entirely sure how this was leaking, but anyways it showed
|
||||
up in ASAN, and it's pointless to strdup here.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/libostree/ostree-bootconfig-parser.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-bootconfig-parser.c b/src/libostree/ostree-bootconfig-parser.c
|
||||
index f7728e4..a2ac107 100644
|
||||
--- a/src/libostree/ostree-bootconfig-parser.c
|
||||
+++ b/src/libostree/ostree-bootconfig-parser.c
|
||||
@@ -28,7 +28,7 @@ struct _OstreeBootconfigParser
|
||||
GObject parent_instance;
|
||||
|
||||
gboolean parsed;
|
||||
- char *separators;
|
||||
+ const char *separators;
|
||||
|
||||
GHashTable *options;
|
||||
GPtrArray *lines;
|
||||
@@ -235,7 +235,6 @@ ostree_bootconfig_parser_finalize (GObject *object)
|
||||
|
||||
g_hash_table_unref (self->options);
|
||||
g_ptr_array_unref (self->lines);
|
||||
- g_free (self->separators);
|
||||
|
||||
G_OBJECT_CLASS (ostree_bootconfig_parser_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -261,6 +260,6 @@ ostree_bootconfig_parser_new (void)
|
||||
OstreeBootconfigParser *self = NULL;
|
||||
|
||||
self = g_object_new (OSTREE_TYPE_BOOTCONFIG_PARSER, NULL);
|
||||
- self->separators = g_strdup (" \t");
|
||||
+ self->separators = " \t";
|
||||
return self;
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 21:12:53 -0500
|
||||
Subject: [ASAN] cmdline: Fix minor leak in delta cmdline entrypoint
|
||||
|
||||
Small, but it's important to stay clean.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/ostree/ot-builtin-static-delta.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c
|
||||
index ca29911..e1c3bb4 100644
|
||||
--- a/src/ostree/ot-builtin-static-delta.c
|
||||
+++ b/src/ostree/ot-builtin-static-delta.c
|
||||
@@ -336,11 +336,13 @@ ot_static_delta_builtin_generate (int argc, char **argv, GCancellable *cancellab
|
||||
g_print ("Generating static delta:\n");
|
||||
g_print (" From: %s\n", from_resolved ? from_resolved : "empty");
|
||||
g_print (" To: %s\n", to_resolved);
|
||||
- if (!ostree_repo_static_delta_generate (repo, OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
|
||||
- from_resolved, to_resolved, NULL,
|
||||
- g_variant_builder_end (parambuilder),
|
||||
- cancellable, error))
|
||||
- goto out;
|
||||
+ { g_autoptr(GVariant) params = g_variant_ref_sink (g_variant_builder_end (parambuilder));
|
||||
+ if (!ostree_repo_static_delta_generate (repo, OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
|
||||
+ from_resolved, to_resolved, NULL,
|
||||
+ params,
|
||||
+ cancellable, error))
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 21:11:37 -0500
|
||||
Subject: [ASAN] delta compilation: More leak fixes
|
||||
|
||||
Now that I remembered to do `env G_SLICE=always-malloc`, lots more
|
||||
leaks become apparent. Nothing major.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
.../ostree-repo-static-delta-compilation.c | 27 +++++++++++-----------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
index 22c45e6..1611d19 100644
|
||||
--- a/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
@@ -132,7 +132,7 @@ xattr_chunk_hash (const void *vp)
|
||||
{
|
||||
const guint8* name;
|
||||
const guint8* value_data;
|
||||
- GVariant *value = NULL;
|
||||
+ g_autoptr(GVariant) value = NULL;
|
||||
gsize value_len;
|
||||
|
||||
g_variant_get_child (v, i, "(^&ay@ay)",
|
||||
@@ -911,9 +911,8 @@ generate_delta_lowlatency (OstreeRepo *repo,
|
||||
|
||||
ostree_object_name_deserialize (serialized_key, &checksum, &objtype);
|
||||
|
||||
- g_variant_ref (serialized_key);
|
||||
if (OSTREE_OBJECT_TYPE_IS_META (objtype))
|
||||
- g_hash_table_add (new_reachable_metadata, serialized_key);
|
||||
+ g_hash_table_add (new_reachable_metadata, g_variant_ref (serialized_key));
|
||||
else
|
||||
{
|
||||
g_autoptr(GFileInfo) finfo = NULL;
|
||||
@@ -955,8 +954,9 @@ generate_delta_lowlatency (OstreeRepo *repo,
|
||||
}
|
||||
|
||||
/* We already ship the to commit in the superblock, don't ship it twice */
|
||||
- g_hash_table_remove (new_reachable_metadata,
|
||||
- ostree_object_name_serialize (to, OSTREE_OBJECT_TYPE_COMMIT));
|
||||
+ { g_autoptr(GVariant) commit = ostree_object_name_serialize (to, OSTREE_OBJECT_TYPE_COMMIT);
|
||||
+ g_hash_table_remove (new_reachable_metadata, commit);
|
||||
+ }
|
||||
|
||||
rollsum_optimized_content_objects = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free,
|
||||
@@ -1359,8 +1359,8 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
|
||||
for (i = 0; i < builder.parts->len; i++)
|
||||
{
|
||||
OstreeStaticDeltaPartBuilder *part_builder = builder.parts->pdata[i];
|
||||
- GBytes *payload_b;
|
||||
- GBytes *operations_b;
|
||||
+ g_autoptr(GBytes) payload_b;
|
||||
+ g_autoptr(GBytes) operations_b;
|
||||
g_autofree guchar *part_checksum = NULL;
|
||||
g_autoptr(GBytes) objtype_checksum_array = NULL;
|
||||
g_autoptr(GBytes) checksum_bytes = NULL;
|
||||
@@ -1415,10 +1415,11 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
|
||||
}
|
||||
|
||||
/* FIXME - avoid duplicating memory here */
|
||||
- delta_part = g_variant_new ("(y@ay)",
|
||||
- compression_type_char,
|
||||
- ot_gvariant_new_ay_bytes (g_memory_output_stream_steal_as_bytes (part_payload_out)));
|
||||
- g_variant_ref_sink (delta_part);
|
||||
+ { g_autoptr(GBytes) payload = g_memory_output_stream_steal_as_bytes (part_payload_out);
|
||||
+ delta_part = g_variant_ref_sink (g_variant_new ("(y@ay)",
|
||||
+ compression_type_char,
|
||||
+ ot_gvariant_new_ay_bytes (payload)));
|
||||
+ }
|
||||
|
||||
if (inline_parts)
|
||||
{
|
||||
@@ -1532,7 +1533,7 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
|
||||
/* floating */ GVariant *to_csum_v =
|
||||
ostree_checksum_to_bytes_v (to);
|
||||
|
||||
- delta_descriptor = g_variant_ref_sink (g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay"
|
||||
+ delta_descriptor = g_variant_ref_sink (g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "@ay"
|
||||
"a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT
|
||||
"@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")",
|
||||
g_variant_builder_end (&metadata_builder),
|
||||
@@ -1540,7 +1541,7 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
|
||||
from_csum_v,
|
||||
to_csum_v,
|
||||
to_commit,
|
||||
- g_variant_builder_new (G_VARIANT_TYPE ("ay")),
|
||||
+ ot_gvariant_new_bytearray ((guchar*)"", 0),
|
||||
part_headers,
|
||||
fallback_headers));
|
||||
g_date_time_unref (now);
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 21:12:23 -0500
|
||||
Subject: [ASAN] deltas: Fix minor memory leak
|
||||
|
||||
We were leaking the checksum, ensure we free it in both normal and
|
||||
error paths.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/libostree/ostree-repo-static-delta-processing.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c
|
||||
index eabe392..ff5a8a1 100644
|
||||
--- a/src/libostree/ostree-repo-static-delta-processing.c
|
||||
+++ b/src/libostree/ostree-repo-static-delta-processing.c
|
||||
@@ -286,6 +286,7 @@ _ostree_static_delta_part_execute (OstreeRepo *repo,
|
||||
|
||||
ret = TRUE;
|
||||
out:
|
||||
+ g_clear_pointer (&state->content_checksum, g_checksum_free);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -941,6 +942,7 @@ dispatch_close (OstreeRepo *repo,
|
||||
goto out;
|
||||
|
||||
g_clear_pointer (&state->xattrs, g_variant_unref);
|
||||
+ g_clear_pointer (&state->content_checksum, g_checksum_free);
|
||||
g_clear_object (&state->content_out);
|
||||
|
||||
state->checksum_index++;
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 22:01:33 -0500
|
||||
Subject: [ASAN] metalink: Fix leaks of buffer
|
||||
|
||||
We should be religious about the "only set output variables on
|
||||
success", otherwise it makes leaks more likely.
|
||||
|
||||
But the real leak was us simply not using autoptr in one place.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/libostree/ostree-metalink.c | 13 ++++++++-----
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-metalink.c b/src/libostree/ostree-metalink.c
|
||||
index ad3d5bf..b3c8b15 100644
|
||||
--- a/src/libostree/ostree-metalink.c
|
||||
+++ b/src/libostree/ostree-metalink.c
|
||||
@@ -479,7 +479,7 @@ try_one_url (OstreeMetalinkRequest *self,
|
||||
|
||||
ret = TRUE;
|
||||
if (out_data)
|
||||
- *out_data = g_bytes_ref (bytes);
|
||||
+ *out_data = g_steal_pointer (&bytes);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
@@ -492,6 +492,7 @@ try_metalink_targets (OstreeMetalinkRequest *self,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
SoupURI *target_uri = NULL;
|
||||
+ g_autoptr(GBytes) ret_data = NULL;
|
||||
|
||||
if (!self->found_a_file_element)
|
||||
{
|
||||
@@ -546,7 +547,7 @@ try_metalink_targets (OstreeMetalinkRequest *self,
|
||||
|
||||
target_uri = self->urls->pdata[self->current_url_index];
|
||||
|
||||
- if (try_one_url (self, target_uri, out_data, &temp_error))
|
||||
+ if (try_one_url (self, target_uri, &ret_data, &temp_error))
|
||||
break;
|
||||
else
|
||||
{
|
||||
@@ -568,6 +569,8 @@ try_metalink_targets (OstreeMetalinkRequest *self,
|
||||
ret = TRUE;
|
||||
if (out_target_uri)
|
||||
*out_target_uri = soup_uri_copy (target_uri);
|
||||
+ if (out_data)
|
||||
+ *out_data = g_steal_pointer (&ret_data);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
@@ -599,7 +602,7 @@ _ostree_metalink_request_sync (OstreeMetalink *self,
|
||||
gboolean ret = FALSE;
|
||||
OstreeMetalinkRequest request = { 0, };
|
||||
g_autoptr(GMainContext) mainctx = NULL;
|
||||
- GBytes *out_contents = NULL;
|
||||
+ g_autoptr(GBytes) contents = NULL;
|
||||
gsize len;
|
||||
const guint8 *data;
|
||||
|
||||
@@ -614,13 +617,13 @@ _ostree_metalink_request_sync (OstreeMetalink *self,
|
||||
self->uri,
|
||||
FALSE,
|
||||
FALSE,
|
||||
- &out_contents,
|
||||
+ &contents,
|
||||
self->max_size,
|
||||
cancellable,
|
||||
error))
|
||||
goto out;
|
||||
|
||||
- data = g_bytes_get_data (out_contents, &len);
|
||||
+ data = g_bytes_get_data (contents, &len);
|
||||
if (!g_markup_parse_context_parse (request.parser, (const char*)data, len, error))
|
||||
goto out;
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 22:03:24 -0500
|
||||
Subject: [ASAN] set-origin: Squash a leak
|
||||
|
||||
Just a minor leak in the commandline.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/ostree/ot-admin-builtin-set-origin.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/ostree/ot-admin-builtin-set-origin.c b/src/ostree/ot-admin-builtin-set-origin.c
|
||||
index 0e79ab5..2b6866c 100644
|
||||
--- a/src/ostree/ot-admin-builtin-set-origin.c
|
||||
+++ b/src/ostree/ot-admin-builtin-set-origin.c
|
||||
@@ -50,7 +50,7 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
|
||||
const char *branch = NULL;
|
||||
glnx_unref_object OstreeRepo *repo = NULL;
|
||||
glnx_unref_object OstreeSysroot *sysroot = NULL;
|
||||
- OstreeDeployment *target_deployment = NULL;
|
||||
+ glnx_unref_object OstreeDeployment *target_deployment = NULL;
|
||||
|
||||
context = g_option_context_new ("REMOTENAME URL [BRANCH]");
|
||||
|
||||
@@ -85,6 +85,8 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
|
||||
"Not currently booted into an OSTree system");
|
||||
goto out;
|
||||
}
|
||||
+ /* To match the below */
|
||||
+ target_deployment = g_object_ref (target_deployment);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 22:00:01 -0500
|
||||
Subject: [ASAN] sysroot: Fix leak/double free of keyfile origin
|
||||
|
||||
Use autoptr rather than manual cleanup. The double free isn't a
|
||||
security problem, since we trust origin files.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/libostree/ostree-deployment.c | 2 +-
|
||||
src/libostree/ostree-sysroot.c | 6 +-----
|
||||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-deployment.c b/src/libostree/ostree-deployment.c
|
||||
index 7b93e6c..67e896b 100644
|
||||
--- a/src/libostree/ostree-deployment.c
|
||||
+++ b/src/libostree/ostree-deployment.c
|
||||
@@ -133,7 +133,6 @@ OstreeDeployment *
|
||||
ostree_deployment_clone (OstreeDeployment *self)
|
||||
{
|
||||
glnx_unref_object OstreeBootconfigParser *new_bootconfig = NULL;
|
||||
- GKeyFile *new_origin = NULL;
|
||||
OstreeDeployment *ret = ostree_deployment_new (self->index, self->osname, self->csum,
|
||||
self->deployserial,
|
||||
self->bootcsum, self->bootserial);
|
||||
@@ -143,6 +142,7 @@ ostree_deployment_clone (OstreeDeployment *self)
|
||||
|
||||
if (self->origin)
|
||||
{
|
||||
+ g_autoptr(GKeyFile) new_origin = NULL;
|
||||
g_autofree char *data = NULL;
|
||||
gsize len;
|
||||
gboolean success;
|
||||
diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c
|
||||
index 608d4cf..70ce156 100644
|
||||
--- a/src/libostree/ostree-sysroot.c
|
||||
+++ b/src/libostree/ostree-sysroot.c
|
||||
@@ -613,8 +613,6 @@ parse_origin (OstreeSysroot *self,
|
||||
out:
|
||||
if (error)
|
||||
g_prefix_error (error, "Parsing %s: ", origin_path);
|
||||
- if (ret_origin)
|
||||
- g_key_file_unref (ret_origin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -689,7 +687,7 @@ parse_deployment (OstreeSysroot *self,
|
||||
glnx_fd_close int deployment_dfd = -1;
|
||||
const char *deploy_basename;
|
||||
g_autofree char *treebootserial_target = NULL;
|
||||
- GKeyFile *origin = NULL;
|
||||
+ g_autoptr(GKeyFile) origin = NULL;
|
||||
g_autofree char *unlocked_development_path = NULL;
|
||||
struct stat stbuf;
|
||||
|
||||
@@ -751,8 +749,6 @@ parse_deployment (OstreeSysroot *self,
|
||||
if (out_deployment)
|
||||
*out_deployment = g_steal_pointer (&ret_deployment);
|
||||
out:
|
||||
- if (origin)
|
||||
- g_key_file_unref (origin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 22:03:53 -0500
|
||||
Subject: [ASAN] tests: Fix leaks
|
||||
|
||||
Just for cleaner sanitizer output.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
tests/test-basic-c.c | 1 -
|
||||
tests/test-keyfile-utils.c | 17 ++++++++++++++---
|
||||
tests/test-libarchive-import.c | 5 +++--
|
||||
tests/test-pull-c.c | 1 +
|
||||
tests/test-rollsum.c | 4 ++--
|
||||
5 files changed, 20 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c
|
||||
index 447c46e..8e7882b 100644
|
||||
--- a/tests/test-basic-c.c
|
||||
+++ b/tests/test-basic-c.c
|
||||
@@ -73,7 +73,6 @@ test_raw_file_to_archive_z2_stream (gconstpointer data)
|
||||
&commit_checksum,
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
- reachable = ostree_repo_traverse_new_reachable ();
|
||||
ostree_repo_traverse_commit (repo,
|
||||
commit_checksum,
|
||||
-1,
|
||||
diff --git a/tests/test-keyfile-utils.c b/tests/test-keyfile-utils.c
|
||||
index 4bf3757..8fd5916 100644
|
||||
--- a/tests/test-keyfile-utils.c
|
||||
+++ b/tests/test-keyfile-utils.c
|
||||
@@ -31,7 +31,7 @@ static GKeyFile *g_keyfile;
|
||||
static void
|
||||
test_get_boolean_with_default (void)
|
||||
{
|
||||
- GError *error = NULL;
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
gboolean out = FALSE;
|
||||
|
||||
GLogLevelFlags always_fatal_mask;
|
||||
@@ -46,18 +46,21 @@ test_get_boolean_with_default (void)
|
||||
FALSE,
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_error (&error);
|
||||
g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile,
|
||||
NULL,
|
||||
"a_boolean_true",
|
||||
FALSE,
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_error (&error);
|
||||
g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile,
|
||||
"section",
|
||||
NULL,
|
||||
FALSE,
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_error (&error);
|
||||
|
||||
/* Restore the old mask. */
|
||||
g_log_set_always_fatal (always_fatal_mask);
|
||||
@@ -86,6 +89,7 @@ test_get_boolean_with_default (void)
|
||||
&error));
|
||||
g_assert_true (out);
|
||||
|
||||
+ g_clear_error (&error);
|
||||
g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile,
|
||||
"a_fake_section",
|
||||
"a_boolean_true",
|
||||
@@ -97,8 +101,8 @@ test_get_boolean_with_default (void)
|
||||
static void
|
||||
test_get_value_with_default (void)
|
||||
{
|
||||
- GError *error = NULL;
|
||||
- char *out = NULL;
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
+ g_autofree char *out = NULL;
|
||||
GLogLevelFlags always_fatal_mask;
|
||||
const char *section = "section";
|
||||
|
||||
@@ -112,18 +116,21 @@ test_get_value_with_default (void)
|
||||
"none",
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
g_assert_false (ot_keyfile_get_value_with_default (g_keyfile,
|
||||
section,
|
||||
NULL,
|
||||
"none",
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
g_assert_false (ot_keyfile_get_value_with_default (g_keyfile,
|
||||
section,
|
||||
NULL,
|
||||
"something",
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
|
||||
/* Restore the old mask. */
|
||||
g_log_set_always_fatal (always_fatal_mask);
|
||||
@@ -135,6 +142,7 @@ test_get_value_with_default (void)
|
||||
&out,
|
||||
&error));
|
||||
g_assert_cmpstr (out, ==, "foo");
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
|
||||
g_assert (ot_keyfile_get_value_with_default (g_keyfile,
|
||||
section,
|
||||
@@ -143,6 +151,7 @@ test_get_value_with_default (void)
|
||||
&out,
|
||||
&error));
|
||||
g_assert_cmpstr (out, ==, "correct");
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
|
||||
g_assert_false (ot_keyfile_get_value_with_default (g_keyfile,
|
||||
"a_fake_section",
|
||||
@@ -150,6 +159,8 @@ test_get_value_with_default (void)
|
||||
"no value",
|
||||
&out,
|
||||
&error));
|
||||
+ g_clear_error (&error);
|
||||
+ g_clear_pointer (&out, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c
|
||||
index 05c5568..254d414 100644
|
||||
--- a/tests/test-libarchive-import.c
|
||||
+++ b/tests/test-libarchive-import.c
|
||||
@@ -180,7 +180,7 @@ static void
|
||||
test_libarchive_autocreate_empty (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
- GError *error = NULL;
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
struct archive *a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new ();
|
||||
@@ -198,7 +198,7 @@ static void
|
||||
test_libarchive_error_device_file (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
- GError *error = NULL;
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
struct archive *a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new ();
|
||||
@@ -563,6 +563,7 @@ int main (int argc, char **argv)
|
||||
|
||||
r = g_test_run();
|
||||
|
||||
+ g_clear_object (&td.repo);
|
||||
if (td.tmpd && g_getenv ("TEST_SKIP_CLEANUP") == NULL)
|
||||
(void) glnx_shutil_rm_rf_at (AT_FDCWD, td.tmpd, NULL, NULL);
|
||||
g_free (td.tmpd);
|
||||
diff --git a/tests/test-pull-c.c b/tests/test-pull-c.c
|
||||
index d784312..43d5d61 100644
|
||||
--- a/tests/test-pull-c.c
|
||||
+++ b/tests/test-pull-c.c
|
||||
@@ -127,6 +127,7 @@ int main (int argc, char **argv)
|
||||
g_test_add_data_func ("/test-pull-c/multi-ok-error-repeat", &td, test_pull_multi_error_then_ok);
|
||||
|
||||
r = g_test_run();
|
||||
+ g_clear_object (&td.repo);
|
||||
|
||||
return r;
|
||||
}
|
||||
diff --git a/tests/test-rollsum.c b/tests/test-rollsum.c
|
||||
index 97aeb0a..1ed9964 100644
|
||||
--- a/tests/test-rollsum.c
|
||||
+++ b/tests/test-rollsum.c
|
||||
@@ -74,8 +74,8 @@ test_rollsum (void)
|
||||
#define MAX_BUFFER_SIZE 1000000
|
||||
gsize i;
|
||||
int len;
|
||||
- unsigned char *a = malloc (MAX_BUFFER_SIZE);
|
||||
- unsigned char *b = malloc (MAX_BUFFER_SIZE);
|
||||
+ g_autofree unsigned char *a = malloc (MAX_BUFFER_SIZE);
|
||||
+ g_autofree unsigned char *b = malloc (MAX_BUFFER_SIZE);
|
||||
g_autoptr(GRand) rand = g_rand_new ();
|
||||
|
||||
/* These two buffers produce the same crc32. */
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From: Simon McVittie <smcv@debian.org>
|
||||
Date: Thu, 1 Dec 2016 11:25:33 +0000
|
||||
Subject: Terminate individual tests after 10 minutes
|
||||
|
||||
While using the Automake parallel test harness, if a test hangs for
|
||||
long enough for an external watchdog to kill the entire build process
|
||||
(as happens in Debian sbuild after 150 minutes with no activity on
|
||||
stdout/stderr), the logs will not be shown. If we make an individual
|
||||
test time out sooner, logs are more likely to be shown.
|
||||
|
||||
We use SIGABRT so that the process(es) under test will dump core,
|
||||
allowing the point at which ostree is blocking to be analyzed.
|
||||
After 1 minute, if any have not died, we kill them again with SIGKILL.
|
||||
|
||||
Signed-off-by: Simon McVittie <smcv@debian.org>
|
||||
Forwarded: https://github.com/ostreedev/ostree/pull/607
|
||||
---
|
||||
buildutil/tap-test | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/buildutil/tap-test b/buildutil/tap-test
|
||||
index c8da31e..4adee45 100755
|
||||
--- a/buildutil/tap-test
|
||||
+++ b/buildutil/tap-test
|
||||
@@ -19,7 +19,7 @@ function skip_cleanup() {
|
||||
echo "Skipping cleanup of ${tempdir}"
|
||||
}
|
||||
cd ${tempdir}
|
||||
-${srcd}/${bn} -k --tap
|
||||
+timeout --kill-after=60 --signal=ABRT 600 ${srcd}/${bn} -k --tap
|
||||
rc=$?
|
||||
case "${TEST_SKIP_CLEANUP:-}" in
|
||||
no|"") cleanup ;;
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
From: Alexander Larsson <alexl@redhat.com>
|
||||
Date: Mon, 28 Nov 2016 17:21:59 +0100
|
||||
Subject: delta compilation: Fix leak
|
||||
|
||||
We need to ref-sik the new varian for g_autoptr to work
|
||||
|
||||
Closes: #597
|
||||
Approved by: cgwalters
|
||||
Origin: upstream, 2016.15, commit:d57036f
|
||||
---
|
||||
.../ostree-repo-static-delta-compilation.c | 22 +++++++++++-----------
|
||||
1 file changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
index 4b0bc50..22c45e6 100644
|
||||
--- a/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
|
||||
@@ -1532,17 +1532,17 @@ ostree_repo_static_delta_generate (OstreeRepo *self,
|
||||
/* floating */ GVariant *to_csum_v =
|
||||
ostree_checksum_to_bytes_v (to);
|
||||
|
||||
- delta_descriptor = g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay"
|
||||
- "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT
|
||||
- "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")",
|
||||
- g_variant_builder_end (&metadata_builder),
|
||||
- GUINT64_TO_BE (g_date_time_to_unix (now)),
|
||||
- from_csum_v,
|
||||
- to_csum_v,
|
||||
- to_commit,
|
||||
- g_variant_builder_new (G_VARIANT_TYPE ("ay")),
|
||||
- part_headers,
|
||||
- fallback_headers);
|
||||
+ delta_descriptor = g_variant_ref_sink (g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay"
|
||||
+ "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT
|
||||
+ "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")",
|
||||
+ g_variant_builder_end (&metadata_builder),
|
||||
+ GUINT64_TO_BE (g_date_time_to_unix (now)),
|
||||
+ from_csum_v,
|
||||
+ to_csum_v,
|
||||
+ to_commit,
|
||||
+ g_variant_builder_new (G_VARIANT_TYPE ("ay")),
|
||||
+ part_headers,
|
||||
+ fallback_headers));
|
||||
g_date_time_unref (now);
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
From: Alexander Larsson <alexl@redhat.com>
|
||||
Date: Mon, 28 Nov 2016 15:31:04 +0100
|
||||
Subject: ostree-repo-traverse: Don't leak floating GVariant
|
||||
|
||||
ostree_object_name_serialize returns a floating ref, so we need
|
||||
to sink it before putting in the hashtable.
|
||||
|
||||
Closes: #595
|
||||
Approved by: cgwalters
|
||||
Origin: upstream, 2016.15, commit:fc107e5
|
||||
---
|
||||
src/libostree/ostree-repo-traverse.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c
|
||||
index e620a8a..46f8324 100644
|
||||
--- a/src/libostree/ostree-repo-traverse.c
|
||||
+++ b/src/libostree/ostree-repo-traverse.c
|
||||
@@ -348,7 +348,7 @@ traverse_iter (OstreeRepo *repo,
|
||||
ostree_repo_commit_traverse_iter_get_file (iter, &name, &checksum);
|
||||
|
||||
g_debug ("Found file object %s", checksum);
|
||||
- key = ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE);
|
||||
+ key = g_variant_ref_sink (ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE));
|
||||
g_hash_table_replace (inout_reachable, key, key);
|
||||
key = NULL;
|
||||
}
|
||||
@@ -363,11 +363,11 @@ traverse_iter (OstreeRepo *repo,
|
||||
|
||||
g_debug ("Found dirtree object %s", content_checksum);
|
||||
g_debug ("Found dirmeta object %s", meta_checksum);
|
||||
- key = ostree_object_name_serialize (meta_checksum, OSTREE_OBJECT_TYPE_DIR_META);
|
||||
+ key = g_variant_ref_sink (ostree_object_name_serialize (meta_checksum, OSTREE_OBJECT_TYPE_DIR_META));
|
||||
g_hash_table_replace (inout_reachable, key, key);
|
||||
key = NULL;
|
||||
|
||||
- key = ostree_object_name_serialize (content_checksum, OSTREE_OBJECT_TYPE_DIR_TREE);
|
||||
+ key = g_variant_ref_sink (ostree_object_name_serialize (content_checksum, OSTREE_OBJECT_TYPE_DIR_TREE));
|
||||
if (!g_hash_table_lookup (inout_reachable, key))
|
||||
{
|
||||
g_hash_table_replace (inout_reachable, key, key);
|
||||
@@ -463,7 +463,7 @@ ostree_repo_traverse_commit_union (OstreeRepo *repo,
|
||||
OstreeRepoCommitState commitstate;
|
||||
gboolean ignore_missing_dirs = FALSE;
|
||||
|
||||
- key = ostree_object_name_serialize (commit_checksum, OSTREE_OBJECT_TYPE_COMMIT);
|
||||
+ key = g_variant_ref_sink (ostree_object_name_serialize (commit_checksum, OSTREE_OBJECT_TYPE_COMMIT));
|
||||
|
||||
if (g_hash_table_contains (inout_reachable, key))
|
||||
break;
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
|
||||
Date: Wed, 23 Nov 2016 13:52:39 -0800
|
||||
Subject: ostree-repo-traverse: Remove an accidental print statement
|
||||
|
||||
Closes: #594
|
||||
Approved by: jlebon
|
||||
Origin: upstream, 2016.15, commit:70d140d
|
||||
---
|
||||
src/libostree/ostree-repo-traverse.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c
|
||||
index 5d99476..e620a8a 100644
|
||||
--- a/src/libostree/ostree-repo-traverse.c
|
||||
+++ b/src/libostree/ostree-repo-traverse.c
|
||||
@@ -407,7 +407,7 @@ traverse_dirtree (OstreeRepo *repo,
|
||||
if (ignore_missing_dirs &&
|
||||
g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
{
|
||||
- g_print ("Ignoring not-found dirmeta %s", checksum);
|
||||
+ g_debug ("Ignoring not-found dirmeta %s", checksum);
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From: Alexander Larsson <alexl@redhat.com>
|
||||
Date: Mon, 28 Nov 2016 15:57:11 +0100
|
||||
Subject: pull: Don't leak delta superblock variants
|
||||
|
||||
Closes: #596
|
||||
Approved by: cgwalters
|
||||
Origin: upstream, 2016.15, commit:36f7824
|
||||
---
|
||||
src/libostree/ostree-repo-pull.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
|
||||
index 303daec..ffa387a 100644
|
||||
--- a/src/libostree/ostree-repo-pull.c
|
||||
+++ b/src/libostree/ostree-repo-pull.c
|
||||
@@ -1478,8 +1478,8 @@ request_static_delta_superblock_sync (OtPullData *pull_data,
|
||||
}
|
||||
}
|
||||
|
||||
- ret_delta_superblock = g_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT,
|
||||
- delta_superblock_data, FALSE);
|
||||
+ ret_delta_superblock = g_variant_ref_sink (g_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT,
|
||||
+ delta_superblock_data, FALSE));
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
@@ -2951,7 +2951,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||
g_autofree char *from_revision = NULL;
|
||||
const char *ref = key;
|
||||
const char *to_revision = value;
|
||||
- GVariant *delta_superblock = NULL;
|
||||
+ g_autoptr(GVariant) delta_superblock = NULL;
|
||||
|
||||
if (!ostree_repo_resolve_rev (pull_data->repo, ref, TRUE,
|
||||
&from_revision, error))
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From: Alexander Larsson <alexl@redhat.com>
|
||||
Date: Mon, 28 Nov 2016 13:58:19 +0100
|
||||
Subject: pull: scan_commit_object() - don't load variant twice
|
||||
|
||||
ostree_repo_load_commit already loaded the object, no need
|
||||
to load it twice.
|
||||
|
||||
Closes: #595
|
||||
Approved by: cgwalters
|
||||
Origin: upstream, 2016.15, commit:c9b158e
|
||||
---
|
||||
src/libostree/ostree-repo-pull.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
|
||||
index 9e96079..6f32c77 100644
|
||||
--- a/src/libostree/ostree-repo-pull.c
|
||||
+++ b/src/libostree/ostree-repo-pull.c
|
||||
@@ -1137,10 +1137,6 @@ scan_commit_object (OtPullData *pull_data,
|
||||
is_partial = pull_data->legacy_transaction_resuming
|
||||
|| (commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) > 0;
|
||||
|
||||
- if (!ostree_repo_load_variant (pull_data->repo, OSTREE_OBJECT_TYPE_COMMIT, checksum,
|
||||
- &commit, error))
|
||||
- goto out;
|
||||
-
|
||||
/* PARSE OSTREE_SERIALIZED_COMMIT_VARIANT */
|
||||
g_variant_get_child (commit, 1, "@ay", &parent_csum);
|
||||
if (g_variant_n_children (parent_csum) > 0)
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
From: Alexander Larsson <alexl@redhat.com>
|
||||
Date: Mon, 28 Nov 2016 15:56:50 +0100
|
||||
Subject: pull_with_options: Don't leak csum_v
|
||||
|
||||
Closes: #596
|
||||
Approved by: cgwalters
|
||||
Origin: upstream, 2016.15, commit:239cb14
|
||||
---
|
||||
src/libostree/ostree-repo-pull.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
|
||||
index 6f32c77..303daec 100644
|
||||
--- a/src/libostree/ostree-repo-pull.c
|
||||
+++ b/src/libostree/ostree-repo-pull.c
|
||||
@@ -2800,7 +2800,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
const char *delta;
|
||||
- GVariant *csum_v = NULL;
|
||||
+ g_autoptr(GVariant) csum_v = NULL;
|
||||
guchar *csum_data = g_malloc (OSTREE_SHA256_DIGEST_LEN);
|
||||
g_autoptr(GVariant) ref = g_variant_get_child_value (deltas, i);
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
ostree-repo-traverse-Remove-an-accidental-print-statement.patch
|
||||
pull-scan_commit_object-don-t-load-variant-twice.patch
|
||||
ostree-repo-traverse-Don-t-leak-floating-GVariant.patch
|
||||
pull_with_options-Don-t-leak-csum_v.patch
|
||||
pull-Don-t-leak-delta-superblock-variants.patch
|
||||
delta-compilation-Fix-leak.patch
|
||||
ASAN-delta-compilation-More-leak-fixes.patch
|
||||
ASAN-deltas-Fix-minor-memory-leak.patch
|
||||
ASAN-cmdline-Fix-minor-leak-in-delta-cmdline-entrypoint.patch
|
||||
traverse-Use-g_hash_table_add.patch
|
||||
ASAN-sysroot-Fix-leak-double-free-of-keyfile-origin.patch
|
||||
ASAN-metalink-Fix-leaks-of-buffer.patch
|
||||
ASAN-bootconfig-Drop-a-pointless-strdup-in-parser.patch
|
||||
ASAN-set-origin-Squash-a-leak.patch
|
||||
ASAN-tests-Fix-leaks.patch
|
||||
Terminate-individual-tests-after-10-minutes.patch
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 28 Nov 2016 21:14:47 -0500
|
||||
Subject: traverse: Use g_hash_table_add
|
||||
|
||||
And "move semantics" via `g_steal_pointer()`. Just a minor code
|
||||
cleanup I noticed when I was hunting for a leak, which ended up being
|
||||
elsewhere.
|
||||
|
||||
Closes: #598
|
||||
Approved by: jlebon
|
||||
---
|
||||
src/libostree/ostree-repo-traverse.c | 9 +++------
|
||||
1 file changed, 3 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c
|
||||
index 46f8324..d125f01 100644
|
||||
--- a/src/libostree/ostree-repo-traverse.c
|
||||
+++ b/src/libostree/ostree-repo-traverse.c
|
||||
@@ -349,8 +349,7 @@ traverse_iter (OstreeRepo *repo,
|
||||
|
||||
g_debug ("Found file object %s", checksum);
|
||||
key = g_variant_ref_sink (ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE));
|
||||
- g_hash_table_replace (inout_reachable, key, key);
|
||||
- key = NULL;
|
||||
+ g_hash_table_add (inout_reachable, g_steal_pointer (&key));
|
||||
}
|
||||
else if (iterres == OSTREE_REPO_COMMIT_ITER_RESULT_DIR)
|
||||
{
|
||||
@@ -364,14 +363,12 @@ traverse_iter (OstreeRepo *repo,
|
||||
g_debug ("Found dirtree object %s", content_checksum);
|
||||
g_debug ("Found dirmeta object %s", meta_checksum);
|
||||
key = g_variant_ref_sink (ostree_object_name_serialize (meta_checksum, OSTREE_OBJECT_TYPE_DIR_META));
|
||||
- g_hash_table_replace (inout_reachable, key, key);
|
||||
- key = NULL;
|
||||
+ g_hash_table_add (inout_reachable, g_steal_pointer (&key));
|
||||
|
||||
key = g_variant_ref_sink (ostree_object_name_serialize (content_checksum, OSTREE_OBJECT_TYPE_DIR_TREE));
|
||||
if (!g_hash_table_lookup (inout_reachable, key))
|
||||
{
|
||||
- g_hash_table_replace (inout_reachable, key, key);
|
||||
- key = NULL;
|
||||
+ g_hash_table_add (inout_reachable, g_steal_pointer (&key));
|
||||
|
||||
if (!traverse_dirtree (repo, content_checksum, inout_reachable,
|
||||
ignore_missing_dirs, cancellable, error))
|
||||
Loading…
Reference in New Issue