Commit 4152a44b by Jakob Pfender Committed by Vicent Marti

delta-apply.c: Move to new error handling mechanism

parent 21dcb75a
...@@ -46,10 +46,10 @@ int git__delta_apply( ...@@ -46,10 +46,10 @@ int git__delta_apply(
* base object, resulting in data corruption or segfault. * base object, resulting in data corruption or segfault.
*/ */
if ((hdr_sz(&base_sz, &delta, delta_end) < 0) || (base_sz != base_len)) if ((hdr_sz(&base_sz, &delta, delta_end) < 0) || (base_sz != base_len))
return GIT_ERROR; return git__throw(GIT_ERROR, "Failed to apply delta. Base size does not match given data");
if (hdr_sz(&res_sz, &delta, delta_end) < 0) if (hdr_sz(&res_sz, &delta, delta_end) < 0)
return GIT_ERROR; return git__throw(GIT_ERROR, "Failed to apply delta. Base size does not match given data");
if ((res_dp = git__malloc(res_sz + 1)) == NULL) if ((res_dp = git__malloc(res_sz + 1)) == NULL)
return GIT_ENOMEM; return GIT_ENOMEM;
...@@ -105,5 +105,5 @@ int git__delta_apply( ...@@ -105,5 +105,5 @@ int git__delta_apply(
fail: fail:
free(out->data); free(out->data);
out->data = NULL; out->data = NULL;
return GIT_ERROR; return git__throw(GIT_ERROR, "Failed to apply delta");
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment