malloc: set pad to 0 on free

The pad value is not used unless element is in pad state, but it
will show up in heap dumps and may be confusing.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
Anatoly Burakov 2018-05-02 16:38:15 +01:00 committed by Thomas Monjalon
parent 3a0d465d4c
commit dc14d4f026

View File

@ -445,6 +445,8 @@ malloc_elem_free(struct malloc_elem *elem)
malloc_elem_free_list_insert(elem);
elem->pad = 0;
/* decrease heap's count of allocated elements */
elem->heap->alloc_count--;