base: Fix UB
This commit is contained in:
@@ -260,9 +260,12 @@ heim_cmp(heim_object_t a, heim_object_t b)
|
||||
static void HEIM_CALLCONV
|
||||
memory_dealloc(void *ptr)
|
||||
{
|
||||
struct heim_base_mem *p = (struct heim_base_mem *)PTR2BASE(ptr);
|
||||
if (p->dealloc)
|
||||
p->dealloc(ptr);
|
||||
if (ptr) {
|
||||
struct heim_base_mem *p = (struct heim_base_mem *)PTR2BASE(ptr);
|
||||
|
||||
if (p->dealloc)
|
||||
p->dealloc(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
struct heim_type_data memory_object = {
|
||||
@@ -672,13 +675,14 @@ heim_object_t
|
||||
heim_auto_release(heim_object_t ptr)
|
||||
{
|
||||
struct heim_base *p;
|
||||
struct ar_tls *tls = autorel_tls();
|
||||
struct ar_tls *tls;
|
||||
heim_auto_release_t ar;
|
||||
|
||||
if (ptr == NULL || heim_base_is_tagged(ptr))
|
||||
return ptr;
|
||||
|
||||
p = PTR2BASE(ptr);
|
||||
tls = autorel_tls();
|
||||
|
||||
/* drop from old pool */
|
||||
if ((ar = p->autorelpool) != NULL) {
|
||||
|
Reference in New Issue
Block a user