summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2012-11-13 16:13:10 -0800
committerCarlos Martín Nieto <cmn@elego.de>2012-11-13 16:17:37 -0800
commit6132a54e0b4b3c5c9b03c0eba191bb756738d34a (patch)
tree315527ec0fbad63de351cb569ec8a3447ac49207 /src/index.c
parent513e794ef47363b8900816a9b141b3eae81eb83e (diff)
downloadlibgit2-6132a54e0b4b3c5c9b03c0eba191bb756738d34a.tar.gz
Fix a few valgrind errors
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c
index 5a3532926..007f19a43 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1098,7 +1098,8 @@ static int read_reuc(git_index *index, const char *buffer, size_t size)
size_t len;
int i;
- if (git_vector_init(&index->reuc, 16, reuc_cmp) < 0)
+ /* This gets called multiple times, the vector might already be initialized */
+ if (index->reuc._alloc_size == 0 && git_vector_init(&index->reuc, 16, reuc_cmp) < 0)
return -1;
while (size) {