Re: [dpdk-dev] [PATCH v2 1/5] devargs: fix memory leak on parsing error From: Thomas Monjalon <hidden> Date: 2021-03-18 09:12:49 18/01/2021 16:16, Xueming Li:quoted hunk ↗ jump to hunk--- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c + if (ret != 0) { + if (devargs->data && devargs->data != devstr) { Better to make comparison explicit: if (devargs->data != NULL + /* Free duplicated data. */ + free(devargs->data); Before patch 2, devargs->data is const, so we cannot free (compilation error).
Keyboard shortcuts hback out one level jnext message in thread kprevious message in thread ldrill in Escclose help / fold thread tree ?toggle this help