Ticket 49693 - A DB_DEADLOCK while adding a tombstone (RUV) leads to access of an already freed entry
Bug Description:
During a ADD, in order to manage DB_DEADLOCK, instead of using the entry provided in the pblock
(i.e. 'e') the code uses a couple addingentry/originalentry.
Only in the initial attempt addingentry refers to 'e', in the others it refers to a duplicate one.
On DB_DEADLOCK, the entry is freed immediately (as it was not in the cache)
if we hit a DB_DEADLOCK then 'e' is freed and the next attempt is with a duplicate of 'e'.
But if the added entry is a tombstone we log a message dumping 'e', unfortunately 'e' was already freed.
Fix Description:
Use addingentry->ep_entry instead of 'e'. Also as it is for logging, test if the logging
level is set before dumping the entry.
https://pagure.io/389-ds-base/issue/49693
Reviewed by: Ludwig Krispenz, Mark Reynolds (thanks !!)
Platforms tested: F26
Flag Day: no
Doc impact: no