neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit aaa24bdd30303128bded8487cd9f63b54c3b8dcd
parent fa82b03e05366e3c6ca1b74c8c83d6e00e0ef1e6
Author: Lars Hjemli <hjemli@gmail.com>
Date:   Sat, 16 Dec 2006 14:58:20 +0100

Add cgit_free_commitinfo() and use where needed

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

Diffstat:
Mcgit.h | 2++
Mshared.c | 10++++++++++
Mui-commit.c | 5+----
Mui-log.c | 5+----
Mui-summary.c | 1+
5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/cgit.h b/cgit.h @@ -65,6 +65,8 @@ extern void cgit_global_config_cb(const char *name, const char *value); extern void cgit_repo_config_cb(const char *name, const char *value); extern void cgit_querystring_cb(const char *name, const char *value); +extern void *cgit_free_commitinfo(struct commitinfo *info); + extern char *fmt(const char *format,...); extern void html(const char *txt); diff --git a/shared.c b/shared.c @@ -88,3 +88,13 @@ void cgit_querystring_cb(const char *name, const char *value) } } +void *cgit_free_commitinfo(struct commitinfo *info) +{ + free(info->author); + free(info->author_email); + free(info->committer); + free(info->committer_email); + free(info->subject); + free(info); + return NULL; +} diff --git a/ui-commit.c b/ui-commit.c @@ -61,8 +61,5 @@ void cgit_print_commit(const char *hex) html("<div class='commit-msg'>"); html_txt(info->msg); html("</div>"); - free(info->author); - free(info->committer); - free(info->subject); - free(info); + cgit_free_commitinfo(info); } diff --git a/ui-log.c b/ui-log.c @@ -28,10 +28,7 @@ void print_commit(struct commit *commit) html("</td><td>"); html_txt(info->author); html("</td></tr>\n"); - free(info->author); - free(info->committer); - free(info->subject); - free(info); + cgit_free_commitinfo(info); } diff --git a/ui-summary.c b/ui-summary.c @@ -35,6 +35,7 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1, html("</td><td>"); html_txt(info->author); html("</td></tr>\n"); + cgit_free_commitinfo(info); } else { html("<tr><td>"); html_txt(buf);