struct patch *next;
};
-static void free_patch(struct patch *patch)
+static void free_fragment_list(struct fragment *list)
{
- 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;
+ while (list) {
+ struct fragment *next = list->next;
+ if (list->free_patch)
+ free((char *)list->patch);
+ free(list);
+ list = next;
}
+}
+
+static void free_patch(struct patch *patch)
+{
+ free_fragment_list(patch->fragments);
free(patch->def_name);
free(patch->old_name);
free(patch->new_name);
/*
* There is no way to apply subproject
* patch without looking at the index.
+ * NEEDSWORK: shouldn't this be flagged
+ * as an error???
*/
+ free_fragment_list(patch->fragments);
patch->fragments = NULL;
}
} else {