hazptr: Fix null domain_ dereference in ~hazptr_array
Summary: Fix a case of null pointer dereference when ~hazptr_array() calls ~hazptr_holder(). For speed hazptr_array doesn't fill the domain_ field of hazptr_holder. The common case is that elements of the array are taken from and returned to the thread cache. If ~hazptr_array() doesn't find enough space in the thread cache, then it calls ~hazptr_holder() with a null domain_. The fix is to set domain_ to &default_hazptr_domain() before calling ~hazptr_holder() in such a case. Reviewed By: yfeldblum Differential Revision: D6928705 fbshipit-source-id: 9c756dce2854a2d1869a0712c4e6ed30f5df6b30
Showing
Please register or sign in to comment