In dm_get_info func, if do_get_info fails, we donot need to call memset to assign 0 to *dmi which will be freed. Here, we remove the useless using of memset in dm_get_info func. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx> --- libmultipath/devmapper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index f597ff8b..00ee0dfc 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -1464,7 +1464,6 @@ dm_get_info (const char * mapname, struct dm_info ** dmi) return 1; if (do_get_info(mapname, *dmi) != 0) { - memset(*dmi, 0, sizeof(struct dm_info)); FREE(*dmi); *dmi = NULL; return 1; -- 2.24.0.windows.2 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel