Skip to content

Commit

Permalink
Merge branch 'sj/refs-symref-referent-fix' into next
Browse files Browse the repository at this point in the history
A double-free that may not trigger in practice by luck has been
corrected in the reference resolution code.

* sj/refs-symref-referent-fix:
  ref-cache: fix invalid free operation in `free_ref_entry`
  • Loading branch information
gitster committed Nov 28, 2024
2 parents 9683f9f + b6318cf commit 65eba16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion refs/ref-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ static void free_ref_entry(struct ref_entry *entry)
* trigger the reading of loose refs.
*/
clear_ref_dir(&entry->u.subdir);
} else {
free(entry->u.value.referent);
}
free(entry->u.value.referent);
free(entry);
}

Expand Down

0 comments on commit 65eba16

Please sign in to comment.