Commit 424222f4 by Jiri Pospisil

Filter: Make sure to release local on error

parent 8443ed6c
...@@ -617,7 +617,7 @@ int git_filter_list_apply_to_data( ...@@ -617,7 +617,7 @@ int git_filter_list_apply_to_data(
si = di; /* swap buffers */ si = di; /* swap buffers */
} else { } else {
tgt->size = 0; tgt->size = 0;
return error; goto cleanup;
} }
} }
...@@ -625,9 +625,10 @@ int git_filter_list_apply_to_data( ...@@ -625,9 +625,10 @@ int git_filter_list_apply_to_data(
if (si != 1) if (si != 1)
git_buf_swap(dbuffer[0], dbuffer[1]); git_buf_swap(dbuffer[0], dbuffer[1]);
cleanup:
git_buf_free(&local); /* don't leak if we allocated locally */ git_buf_free(&local); /* don't leak if we allocated locally */
return 0; return error;
} }
int git_filter_list_apply_to_file( int git_filter_list_apply_to_file(
......
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