Merge branch 'ab/strbuf-addftime-tzname-boolify'
[gitweb.git] / commit.c
index 713f09feb04116fc1529cbca1ca9cbd38e4e4379..cbfd6899392e8715b206c96b3b58cbdaf29c77cd 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -168,7 +168,7 @@ struct commit_graft *read_graft_line(char *buf, int len)
 
 static int read_graft_file(const char *graft_file)
 {
-       FILE *fp = fopen(graft_file, "r");
+       FILE *fp = fopen_or_warn(graft_file, "r");
        struct strbuf buf = STRBUF_INIT;
        if (!fp)
                return -1;
@@ -287,8 +287,7 @@ void free_commit_buffer(struct commit *commit)
 {
        struct commit_buffer *v = buffer_slab_peek(&buffer_slab, commit);
        if (v) {
-               free(v->buffer);
-               v->buffer = NULL;
+               FREE_AND_NULL(v->buffer);
                v->size = 0;
        }
 }