cryptodev: fix memory leak during stats query
PATCH 1/1 cryptodev: fix memory leak during stats query
object_get_canonical_path already returns newly allocated memory, this means no additional g_strdup required. Remove g_strdup to avoid memory leak.
--- backends/cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
backends/cryptodev.c +1 -1
@@ -522,7 +522,7 @@ static int cryptodev_backend_stats_query(Object *obj, void *data) entry =g_new0 (StatsResult,1 ); entry->provider =STATS_PROVIDER_CRYPTODEV ; - entry->qom_path =g_strdup (object_get_canonical_path (obj)); + entry->qom_path =object_get_canonical_path (obj); entry->stats = stats_list;QAPI_LIST_PREPEND (*stats_results, entry);
Signature · 1 line
2.34.1
Quoted 10 lines · zhenwei pi
object_get_canonical_pathalready returns newly allocated memory, this means no additionalg_strduprequired. Removeg_strdupto avoid memory leak.Fixes Coverity CID 1508074Fixes f2b901098 ("cryptodev: Support query-stats QMP command")Cc Peter Maydell <[email protected]>Signed-off-by zhenwei pi <[email protected]>---
thanks
-- PMM
Quoted 12 lines · Peter Maydell
Quoted 10 lines · zhenwei pi
object_get_canonical_pathalready returns newly allocated memory, this means no additionalg_strduprequired. Removeg_strdupto avoid memory leak.Fixes Coverity CID 1508074Fixes f2b901098 ("cryptodev: Support query-stats QMP command")Cc Peter Maydell <[email protected]>Signed-off-by zhenwei pi <[email protected]>---
Quoted 4 lines
Reviewed-by Peter Maydell <[email protected]>thanks
-- PMM
Hi, Michael
This patch has been ignored, could you please merge this in next PR?
Signature · 1 line
zhenwei pi
Quoted 15 lines · zhenwei pi
Quoted 12 lines · Peter Maydell
Quoted 10 lines · zhenwei pi
object_get_canonical_pathalready returns newly allocated memory, this means no additionalg_strduprequired. Removeg_strdupto avoid memory leak.Fixes Coverity CID 1508074Fixes f2b901098 ("cryptodev: Support query-stats QMP command")Cc Peter Maydell <[email protected]>Signed-off-by zhenwei pi <[email protected]>---
Quoted 12 lines
Quoted 4 lines
Reviewed-by Peter Maydell <[email protected]>thanks
-- PMMHi, Michael
This patch has been ignored, could you please merge this in next PR?
Signature · 1 line
zhenwei pi
I don't know why - didn't have it in my inbox. Tagged now, thanks!