mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 20:14:44 +00:00
attrcache: fix use-after-free
Reported by coverity.
This commit is contained in:
parent
a15d3537bb
commit
7839931019
@ -229,8 +229,8 @@ int git_attr_cache__get(
|
|||||||
if (error < 0) {
|
if (error < 0) {
|
||||||
/* remove existing entry */
|
/* remove existing entry */
|
||||||
if (file) {
|
if (file) {
|
||||||
git_attr_file__free(file); /* offset incref from lookup */
|
|
||||||
attr_cache_remove(cache, file);
|
attr_cache_remove(cache, file);
|
||||||
|
git_attr_file__free(file); /* offset incref from lookup */
|
||||||
file = NULL;
|
file = NULL;
|
||||||
}
|
}
|
||||||
/* no error if file simply doesn't exist */
|
/* no error if file simply doesn't exist */
|
||||||
|
Loading…
Reference in New Issue
Block a user