Re: [PATCH 08/13] securityselinuxhelper: Use g_new0() instead of malloc()+memset() combo

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

 



On 8/3/23 13:29, Claudio Fontana wrote:
> On 8/3/23 12:36, Michal Privoznik wrote:
>> Inside of securityselinuxhelper we still use malloc() +
>> memset(.., 0, ...) combo. Convert it to g_new0().
>>
>> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> 
> I don't think it is a good idea to mix Glib g_new, g_free etc with malloc, calloc, free.
> 
> If you go with g_new0 here, imo you need to also change the calls to free() to g_free.
> 
> The alternative is to use calloc instead, then you could leave the existing free calls alone.


Ah, good catch! Let me drop this from the series and post a switch to
calloc() then.

Thanks!

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux