Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit-graph: release strbufs after use
author
René Scharfe
<l.s.r@web.de>
Wed, 7 Aug 2019 11:15:02 +0000
(13:15 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 7 Aug 2019 19:24:01 +0000
(12:24 -0700)
Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5b15eb3
)
diff --git
a/commit-graph.c
b/commit-graph.c
index c91e6f0fb821582706b3c9ee232da1335ea7427d..fa0760c430cd6a007972affa9e40742e5e41f106 100644
(file)
--- a/
commit-graph.c
+++ b/
commit-graph.c
@@
-432,6
+432,7
@@
static struct commit_graph *load_commit_graph_chain(struct repository *r, const
free(oids);
fclose(fp);
free(oids);
fclose(fp);
+ strbuf_release(&line);
return graph_chain;
}
return graph_chain;
}
@@
-1179,7
+1180,7
@@
static int fill_oids_from_packs(struct write_commit_graph_context *ctx,
}
stop_progress(&ctx->progress);
}
stop_progress(&ctx->progress);
- strbuf_re
set
(&progress_title);
+ strbuf_re
lease
(&progress_title);
strbuf_release(&packname);
return 0;
strbuf_release(&packname);
return 0;
@@
-1706,10
+1707,8
@@
static void expire_commit_graphs(struct write_commit_graph_context *ctx)
strbuf_addstr(&path, "/info/commit-graphs");
dir = opendir(path.buf);
strbuf_addstr(&path, "/info/commit-graphs");
dir = opendir(path.buf);
- if (!dir) {
- strbuf_release(&path);
- return;
- }
+ if (!dir)
+ goto out;
strbuf_addch(&path, '/');
dirnamelen = path.len;
strbuf_addch(&path, '/');
dirnamelen = path.len;
@@
-1738,6
+1737,9
@@
static void expire_commit_graphs(struct write_commit_graph_context *ctx)
if (!found)
unlink(path.buf);
}
if (!found)
unlink(path.buf);
}
+
+out:
+ strbuf_release(&path);
}
int write_commit_graph(const char *obj_dir,
}
int write_commit_graph(const char *obj_dir,