malloc: fix realloc copy size
authorXueming Li <xuemingl@mellanox.com>
Tue, 12 Nov 2019 14:50:27 +0000 (14:50 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 20 Nov 2019 13:08:39 +0000 (14:08 +0100)
commita029a060369f74f42394301f87489aeb391220ef
tree8de1bf8a976047f2575c86ea65aed9b0dce022da
parent37a95bbff027885f6f5968fd5c6cf689727ecb7c
malloc: fix realloc copy size

In rte_realloc, if the old element has pad and need to allocate a new
memory, the padding size was not deducted, so more data was copied to
new data area.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/rte_malloc.c