ref-filter: initialize eaten variable
Initialize variable `eaten` before its using. We may initialize it in parse_object_buffer(), but there are cases when we do not reach this invocation. Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Olga Telezhnaya committed
Jul 17, 2018 at 08:22 UTC
04f6ee1a58ec988b3260846812349b39dc08d06b
1 file changed
+2
-1
ref-filter.c
+2
-1
@@ -1439,7 +1439,8 @@ static const char *get_refname(struct used_atom *atom, struct ref_array_item *re
1439
static int get_object(struct ref_array_item *ref, const struct object_id *oid,
1440
int deref, struct object **obj, struct strbuf *err)
1441
{
1442
- int eaten;
1442
+ /* parse_object_buffer() will set eaten to 0 if free() will be needed */
1443
+ int eaten = 1;
1444
int ret = 0;
1445
unsigned long size;
1446
void *buf = get_obj(oid, obj, &size, &eaten);