static void free_patch(struct patch *patch)
{
- while (patch) {
- struct patch *patch_next = patch->next;
- struct fragment *fragment = patch->fragments;
-
- while (fragment) {
- struct fragment *fragment_next = fragment->next;
- if (fragment->patch != NULL && fragment->free_patch)
- free((char *)fragment->patch);
- free(fragment);
- fragment = fragment_next;
- }
- free(patch);
- patch = patch_next;
+ struct fragment *fragment = patch->fragments;
+
+ while (fragment) {
+ struct fragment *fragment_next = fragment->next;
+ if (fragment->patch != NULL && fragment->free_patch)
+ free((char *)fragment->patch);
+ free(fragment);
+ fragment = fragment_next;
+ }
+ free(patch);
+}
+
+static void free_patch_list(struct patch *list)
+{
+ while (list) {
+ struct patch *next = list->next;
+ free_patch(list);
+ list = next;
}
}
if (summary)
summary_patch_list(list);
- free_patch(list);
+ free_patch_list(list);
strbuf_release(&buf);
return 0;
}