* Frees memory within pl which was allocated for exclude patterns and * the file buffer. Does not free pl itself. */
| 1014 | * the file buffer. Does not free pl itself. |
| 1015 | */ |
| 1016 | void clear_pattern_list(struct pattern_list *pl) |
| 1017 | { |
| 1018 | int i; |
| 1019 | |
| 1020 | for (i = 0; i < pl->nr; i++) |
| 1021 | free(pl->patterns[i]); |
| 1022 | free(pl->patterns); |
| 1023 | clear_pattern_entry_hashmap(&pl->recursive_hashmap); |
| 1024 | clear_pattern_entry_hashmap(&pl->parent_hashmap); |
| 1025 | |
| 1026 | memset(pl, 0, sizeof(*pl)); |
| 1027 | } |
| 1028 | |
| 1029 | static void trim_trailing_spaces(char *buf) |
| 1030 | { |