Commit 4edaa283 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Use FREE_OBJ for VEV

This was actually done with a Coccinelle patch after finding plain
free() calls out of tree:

    $ cat >free_obj.cocci <<EOF
    @@
    expression obj, objp, magic;
    @@

    (
    TAKE_OBJ_NOTNULL(obj, objp, magic);
    |
    CAST_OBJ_NOTNULL(obj, objp, magic);
    |
    CHECK_OBJ_NOTNULL(obj, magic);
    |
    CHECK_OBJ_ORNULL(obj, magic);
    |
    CHECK_OBJ(obj, magic);
    )
    ...
    - free(obj);
    + FREE_OBJ(obj);
    $ spatch --dir . --in-place --sp-file free_obj.cocci

Asking again, could we consider keeping Coccinelle patches around?
parent 1c0a2012
...@@ -222,9 +222,8 @@ VEV_Destroy(struct vev_root **evbp) ...@@ -222,9 +222,8 @@ VEV_Destroy(struct vev_root **evbp)
assert(evb->thread == pthread_self()); assert(evb->thread == pthread_self());
free(evb->pfd); free(evb->pfd);
free(evb->pev); free(evb->pev);
/* destroy evb->binheap */ /* XXX: destroy evb->binheap */
evb->magic = 0; FREE_OBJ(evb);
free(evb);
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment