[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8452) LMDB: mdb_env_copyfd2 can deadlock due to missing mdb_env_cthr_toggle check



On 28. juni 2016 13:06, Lorenz Bauer wrote:
> I had a look at your changes, it seems like they obsolete my other bug report
> as well.

Good, I'll close that.

> At the same time, I think you are introducing a double free? In copyfd1, if
> memalign (and friends) fails you goto done, which then proceeds to free().
> Same for the case where CreateMutex or CreateFree return an error, since they
> happen before allocation, but also goto done.

In those cases the code leaves the HANDLE or pointer = NULL.  free(NULL)
does nothing. The "done:" code omits CloseHandle when the handle is NULL.

Hmm. Unless failed posix_memalign() may put garbage in the destination
pointer.  Probably not, but can tweak the code to be safe just in case.

-- 
Hallvard