diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 10:07:05 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 10:07:05 -0400 |
commit | 61518be4c21d6d437e6f59c0599f6df083053ff8 (patch) | |
tree | a87b9e4378146a4040bca36d208cc6debc927e30 /git.c | |
parent | 03860c7b8e6fa95133ba44b49ac0461501a7b728 (diff) |
Added `free_files()`, and `free_file()`.
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -64,6 +64,23 @@ void cleanup_git(git_repository **repos) { git_libgit2_shutdown(); } +void free_file(file *file) { + if (file->name != NULL) { + free(file->name); + } + if (file->buf != NULL) { + free(file->buf); + } +} + +void free_files(file **files) { + for (int i = 0; files[i] != NULL; i++) { + free_file(files[i]); + files[i] = NULL; + } + free(files); +} + pull_request *get_pull_request(int id, const char *root) { } |