Re: [PATCH] Remove duplicated code in mpath_alloc_prin_response()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Bart,

Thanks for your review. Using calloc() is really better than malloc(). I will modify and commit it later.

Thanks,

Ding Yemin.



Bart Van Assche <bart.vanassche@xxxxxxxxxxx>

2016-10-28 23:16

收件人
<ding.yemin@xxxxxxxxxx>, Christophe Varoqui <christophe.varoqui@xxxxxxxxxxx>,
抄送
<tang.junhui@xxxxxxxxxx>, <zhang.kai16@xxxxxxxxxx>, <dm-devel@xxxxxxxxxx>
主题
Re: [dm-devel] [PATCH] Remove duplicated code in mpath_alloc_prin_response()





On 10/25/2016 01:19 AM, ding.yemin@xxxxxxxxxx wrote:
>                   }
> +                 if (size > 0)
> +                 {
> +                                  ptr = malloc(size);
> +                                  if (ptr)
> +                                  {
> +                                                   memset(ptr, 0, size);
> +                                  }
> +                 }
>                   return ptr;
>  }

Hello Ding Yemin,

Please use calloc() instead of open coding it.

Thanks,

Bart.


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux