[SSSD] [PATCH] ELAPI: Ticket 161: Initialize structures with calloc instead of enumerating members

Stephen Gallagher sgallagh at redhat.com
Mon Sep 21 15:45:05 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/21/2009 11:34 AM, Dmitri Pal wrote:
> Stephen Gallagher wrote:
>> On 09/20/2009 07:21 AM, Jakub Hrozek wrote:
>>> On 09/18/2009 08:57 PM, Dmitri Pal wrote:
>>>> After reflecting on the matter a bit (while Steven was holding the
>>>> mirror) I suggest a Nack.
>>>> There are other places that need to be looked at.
>>>> ./providers/file/file_fmt_csv.c:    cfg = (struct file_csv_cfg
>>>> *)malloc(sizeof(struct file_csv_cfg));
>>> OK, I spotted this one before and thought we didn't need a calloc b/c
>>> all the structure members are initialized later on. But I guess it can't
>>> hurt, esp. when extending the structure.
>>
>>>> ./elapi_log.c:    handle = (struct elapi_dispatcher *)
>>>> malloc(sizeof(struct elapi_dispatcher));
>>> Done. We did a malloc&memset, but calloc is cleaner solution I guess
>>
>>
>>>> Please use grep malloc across the whole elapi tree and check if I
>> missed
>>>> something too.
>>> done, only string allocation and similar.
>>
>>> New patch is attached,
>>>     Jakub
>>
>> Looks good to me. I'll conditionally Ack, pending Dmitri's approval.
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> sssd-devel mailing list
>> sssd-devel at lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/sssd-devel
>>
>>
> 
> Ack
> 
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel
> 

Pushed to master.

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq3n34ACgkQeiVVYja6o6PtQACbBzguzPtlOs87jyB9z+CumG55
qwoAn29MmlBHaf3yrsPsELwoO1xwXxQZ
=DJhL
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list