static-delta: Set error on bsdiff failure

bsdiff can fail when generating static deltas, particularly if
not enough memory is available. Set error properly when this happens.

https://bugzilla.gnome.org/show_bug.cgi?id=756260
This commit is contained in:
John Hiesey 2015-10-01 17:26:47 -07:00 committed by Colin Walters
parent f2b4a9e107
commit 60e5529ba0

View File

@ -829,8 +829,10 @@ process_one_bsdiff (OstreeRepo *repo,
op.cancellable = cancellable;
op.error = error;
stream.opaque = &op;
if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0)
if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0) {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "bsdiff generation failed");
goto out;
}
payload = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (out));
payload_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (out));