[dm-devel] [PATCH] dm_mapname fix in multipath-tools-0.4.4-pre11

christophe varoqui christophe.varoqui at free.fr
Mon Apr 11 20:26:22 UTC 2005


Nice :)
Applied, thanks.

Careful with pre11, you might have noticed the memory audit surgery is
not without glitches.

Regards,
cvaroqui

On lun, 2005-04-11 at 16:15 -0400, k-ueda at ct.jp.nec.com wrote:
> Hi Christophe,
> 
> In multipath-tools-0.4.4-pre11 kpartx/devmapper.c:135:
> -------------------------------------------
>         mapname = dm_task_get_name(dmt);
> out:
>         dm_task_destroy(dmt);
>         return mapname;
> }
> -------------------------------------------
> 
> dm_task_get_name returns a pointer to dmt->dmi.v4->name
> which will be freed at dm_task_destroy() just before return.
> 
> 
> --- multipath-tools-0.4.4-pre11/kpartx/devmapper.c      2005-04-07 09:47:26.000000000 -0400
> +++ dm-mapname-fix/kpartx/devmapper.c   2005-04-12 04:15:14.990239582 -0400
> @@ -132,7 +132,7 @@ dm_mapname(int major, int minor)
>         if (!dm_task_run(dmt))
>                 goto out;
> 
> -       mapname = dm_task_get_name(dmt);
> +       mapname = strdup(dm_task_get_name(dmt));
>  out:
>         dm_task_destroy(dmt);
>         return mapname;
> 
> 
> Regards,
> Ky (Kiyoshi Ueda)
> 
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
-- 
christophe varoqui <christophe.varoqui at free.fr>





More information about the dm-devel mailing list