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

Dmitri Pal dpal at redhat.com
Fri Sep 18 18:57:05 UTC 2009


Dmitri Pal wrote:
> Stephen Gallagher wrote:
>   
>> On 09/18/2009 05:37 AM, Jakub Hrozek wrote:
>>     
>>> please see the patch
>>>       
>> Ack, but not pushing without Dmitri's review.
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> sssd-devel mailing list
>> sssd-devel at lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/sssd-devel
>>
>>
>>     
> In general I agree with the patch but it misses couple other places I
> wanted to touch .
> I suggest I take this patch into my tree and embed into my code. I hope
> it is Ok with everybody.
> The only question I have is how to apply this patch manually.
> What is the procedure/command?  I never did this before.
>
> Thanks
> Dmitri
>
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel
>   
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));
./elapi_log.c:    handle = (struct elapi_dispatcher *)
malloc(sizeof(struct elapi_dispatcher));

Please use grep malloc across the whole elapi tree and check if I missed
something too.
I do not think we need calloc in case of  struct elapi_async_ctx and in
the elapi_event.c when we do parsing
but other places should be changed in the same style as in the patch or
at least looked at and probably a comment
added that "malloc is Ok here because XYZ" ...

-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the sssd-devel mailing list