Skip to content

Commit

Permalink
hp_malloc: run check_double_free() under lock
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Feb 4, 2020
1 parent 410c664 commit 41714f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mem/hp_malloc_dyn.h
Expand Up @@ -1041,11 +1041,11 @@ void hp_shm_free(struct hp_block *hpb, void *p,
}

f = HP_FRAG(p);
check_double_free(p, f, hpb);

hash = PEEK_HASH_RR(hpb, f->size);

SHM_LOCK(hash);
check_double_free(p, f, hpb);
hp_frag_attach(hpb, f);
#ifdef DBG_MALLOC
f->file=file;
Expand Down Expand Up @@ -1082,11 +1082,11 @@ void hp_rpm_free(struct hp_block *hpb, void *p,
}

f = HP_FRAG(p);
check_double_free(p, f, hpb);

hash = PEEK_HASH_RR(hpb, f->size);

RPM_LOCK(hash);
check_double_free(p, f, hpb);
hp_frag_attach(hpb, f);
#ifdef DBG_MALLOC
f->file=file;
Expand Down

0 comments on commit 41714f1

Please sign in to comment.