diff options
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 04b9dcaf0f..f3b16520c2 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -388,8 +388,7 @@ static struct base_data *alloc_base_data(void) static void free_base_data(struct base_data *c) { if (c->data) { - free(c->data); - c->data = NULL; + FREE_AND_NULL(c->data); get_thread_data()->base_cache_used -= c->size; } } @@ -605,8 +604,7 @@ static void *unpack_data(struct object_entry *obj, git_inflate_end(&stream); free(inbuf); if (consume) { - free(data); - data = NULL; + FREE_AND_NULL(data); } return data; } |