From 822dab77f7bf3c6a84634cd369a21dce341ae936 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 25 Jul 2018 11:22:33 +0100 Subject: [PATCH] d/p/lib-pull-Fix-minor-memleak-in-error-path.patch: Apply a memory leak fix from upstream --- debian/changelog | 2 ++ ...pull-Fix-minor-memleak-in-error-path.patch | 33 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 36 insertions(+) create mode 100644 debian/patches/lib-pull-Fix-minor-memleak-in-error-path.patch create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 166d5da1..0944e4d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ostree (2018.7-1) UNRELEASED; urgency=medium * New upstream release - d/libostree-1-1.symbols: Update - Drop all patches, applied upstream + * d/p/lib-pull-Fix-minor-memleak-in-error-path.patch: + Apply a memory leak fix from upstream -- Simon McVittie Wed, 04 Jul 2018 13:37:44 +0100 diff --git a/debian/patches/lib-pull-Fix-minor-memleak-in-error-path.patch b/debian/patches/lib-pull-Fix-minor-memleak-in-error-path.patch new file mode 100644 index 00000000..36d625b9 --- /dev/null +++ b/debian/patches/lib-pull-Fix-minor-memleak-in-error-path.patch @@ -0,0 +1,33 @@ +From: Colin Walters +Date: Thu, 19 Jul 2018 12:46:23 +0000 +Subject: lib/pull: Fix minor memleak in error path + +Spotted by a downstream Coverity build. + +Bug: #1684 +Reviewed-by: jlebon +Origin: upstream, 2018.8, commit:93da56842259f18bde23daf17dcefcf213b30b81 +--- + 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 9553272..a8fee07 100644 +--- a/src/libostree/ostree-repo-pull.c ++++ b/src/libostree/ostree-repo-pull.c +@@ -4131,7 +4131,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, + { + const char *delta; + 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); + + g_variant_get_child (ref, 0, "&s", &delta); +@@ -4140,6 +4139,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, + if (!validate_variant_is_csum (csum_v, error)) + goto out; + ++ guchar *csum_data = g_malloc (OSTREE_SHA256_DIGEST_LEN); + memcpy (csum_data, ostree_checksum_bytes_peek (csum_v), 32); + g_hash_table_insert (pull_data->summary_deltas_checksums, + g_strdup (delta), diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..ad0ed6ab --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +lib-pull-Fix-minor-memleak-in-error-path.patch