diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index 94876fa448..5b4a960f79 100644 --- a/src/libostree/ostree-repo-static-delta-processing.c +++ b/src/libostree/ostree-repo-static-delta-processing.c @@ -423,10 +423,11 @@ dispatch_bspatch (OstreeRepo *repo, StaticDeltaExecutionState *state, GCancellab struct bspatch_stream stream; stream.read = bspatch_read; stream.opaque = &opaque; - if (bspatch ((const guint8 *)g_mapped_file_get_contents (input_mfile), - g_mapped_file_get_length (input_mfile), buf, state->content_size, &stream) + g_autofree const guint8 *old = (const guint8 *)g_mapped_file_get_contents (input_mfile); + if (bspatch (old, g_mapped_file_get_length (input_mfile), buf, + state->content_size, &stream) < 0) - return glnx_throw (error, "bsdiff patch failed"); + return glnx_throw (error, "bsdiff patch failed"); if (!_ostree_repo_bare_content_write (repo, &state->content_out, buf, state->content_size, cancellable, error))