[Issue 9567] Double free error after attempt to insert a duplicate entry