filesystem_iterator: fixed double free on error#3904
Conversation
|
The fix as-is does not suffice, unfortunately. Problem is that we may jump to the So in addition to your improvement, we should also move up initialization of the callbacks. |
df2552d to
7a3f1de
Compare
|
Ugh, sorry. You're right. I didn't pay close enough attention to where the callbacks are set. I moved the initialization of the base members above the initialization of the filesystem members. |
|
No worries, the error existed already before you touching the code. Thanks for the fix. I'll wait another day for comments and then merge tomorrow if none are incoming. |
|
Thanks @hackhaslam ! ❤️ |
git_iterator_freetries to freeiter->root(anditer->current_path) via thefilesystem_iterator_freecallback after it has already been freed. I couldn't figure out what caused theon_errorcase to begin with or else I would have tried to make a test case.