]> git.proxmox.com Git - libgit2.git/commit - tests/index/addall.c
Add tests and fix use of freed memory
authorRussell Belfer <rb@github.com>
Wed, 19 Jun 2013 22:54:19 +0000 (15:54 -0700)
committerRussell Belfer <rb@github.com>
Wed, 19 Jun 2013 22:54:19 +0000 (15:54 -0700)
commit7863523a1be51981bafee9d13b3344fb4ff47347
treeff0f851b89ad1e0a72a980f402d0cac0c4d028a6
parentf30fff45a752cb0781067ad48c283e49345a5813
Add tests and fix use of freed memory

This adds some tests for updating the index and having it remove
items to make sure that the iteration over the index still works
even as earlier items are removed.

In testing with valgrind, this found a path that would use the
path string from the index entry after it had been freed.  The
bug fix is simply to copy the path of the index entry before
doing any actual index manipulation.
src/index.c
tests-clar/index/addall.c