locks must be matched with unlocks. Also, use calloc to allocate the
block so that it is properly zero'd. Thanks to Nick Kledzik for
tracking this down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69314
91177308-0d34-0410-b5e6-
96231b3b80d8
// The key is created on demand, and libgcc creates it the first time an
// exception occurs. Since we need the key to register frames, we create
// it now.
- if (!LOI) {
- LOI = (LibgccObjectInfo*)malloc(sizeof(struct LibgccObjectInfo));
- _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST,
- LOI);
- }
+ if (!LOI)
+ LOI = (LibgccObjectInfo*)calloc(sizeof(struct LibgccObjectInfo), 1);
+ _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST, LOI);
InstallExceptionTableRegister(DarwinRegisterFrame);
#else
InstallExceptionTableRegister(__register_frame);