From: Colin Walters Date: Tue, 29 Nov 2016 02:12:23 +0000 (-0500) Subject: deltas: Fix minor memory leak X-Git-Tag: archive/raspbian/2017.12-1+rpi1~1^2^2^2^2^2^2^2^2^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a5a184267d95a35d4d68999ec1358da673d306e3;p=ostree.git 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 Gbp-Pq: Name ASAN-deltas-Fix-minor-memory-leak.patch --- diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index eabe3925..ff5a8a1a 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++;