Introduction
Introduction Statistics Contact Development Disclaimer Help
fix a small memleak in writeatom() - stagit - static git page generator
git clone git://git.codemadness.org/stagit
Log
Files
Refs
README
LICENSE
---
commit 5334f3e0009bb7d5835c3bad60db507bfd146930
parent dc0709f6f4f7e256e27272cb0b8611715caf1f3b
Author: Hiltjo Posthuma <[email protected]>
Date: Mon, 10 Aug 2020 16:09:46 +0200
fix a small memleak in writeatom()
non-tag references were not freed.
Diffstat:
M stagit.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/stagit.c b/stagit.c
@@ -865,21 +865,17 @@ writeatom(FILE *fp, int all)
commitinfo_free(ci);
}
git_revwalk_free(w);
- } else {
+ } else if (getrefs(&ris, &refcount) != -1) {
/* references: tags */
- if (getrefs(&ris, &refcount) != -1) {
- for (i = 0; i < refcount; i++) {
- if (!git_reference_is_tag(ris[i].ref))
- continue;
-
+ for (i = 0; i < refcount; i++) {
+ if (git_reference_is_tag(ris[i].ref))
printcommitatom(fp, ris[i].ci,
git_reference_shorthand(ris[i]…
- commitinfo_free(ris[i].ci);
- git_reference_free(ris[i].ref);
- }
- free(ris);
+ commitinfo_free(ris[i].ci);
+ git_reference_free(ris[i].ref);
}
+ free(ris);
}
fputs("</feed>\n", fp);
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.