Commit 78399310 by Carlos Martín Nieto

attrcache: fix use-after-free

Reported by coverity.
parent a15d3537
......@@ -229,8 +229,8 @@ int git_attr_cache__get(
if (error < 0) {
/* remove existing entry */
if (file) {
git_attr_file__free(file); /* offset incref from lookup */
attr_cache_remove(cache, file);
git_attr_file__free(file); /* offset incref from lookup */
file = NULL;
}
/* no error if file simply doesn't exist */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment