diff options
author | Colby Ranger <cranger@google.com> | 2012-12-03 12:23:14 -0800 |
---|---|---|
committer | Colby Ranger <cranger@google.com> | 2012-12-03 12:46:53 -0800 |
commit | b9e485661dd0ecad67585ed0e24cb0ab025085a7 (patch) | |
tree | 6b15d2da013383971863f07e5386871803f5636e | |
parent | 4213a91c97c68d7a4ee1450210f55ebeab401654 (diff) | |
download | jgit-b9e485661dd0ecad67585ed0e24cb0ab025085a7.tar.gz jgit-b9e485661dd0ecad67585ed0e24cb0ab025085a7.zip |
Fix DeltaWindow.clear() to release loaded buffer bytes.
It is possible for the buffer to be set but not the index. It
ocurrs when an exception occurs during creating an index, but
after the buffer is loaded. Furthermore, the cleared DeltaWindowEntry
should have been ent and not res.
Change-Id: I2e0d79540316635bf7aa43efd225e4eb38230844
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java index fead2147bf..c51cafcbf2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java @@ -167,7 +167,7 @@ class DeltaWindow { private void clear(DeltaWindowEntry ent) { if (ent.index != null) loaded -= ent.index.getIndexSize(); - else if (res.buffer != null) + else if (ent.buffer != null) loaded -= ent.buffer.length; ent.set(null); } |