[ovs-dev] [PATCH] ofproto-dpif: Use xzalloc instead of xmalloc

Sabyasachi Sengupta Sabyasachi.Sengupta at alcatel-lucent.com
Sat Jun 6 04:46:52 UTC 2015


Ah, I see the out_of_memory code.. I'd resend without the NULL checks (with 
just the conversion to xzalloc).

---
Nuage Networks Business Unit, Alcatel-Lucent,
755 Ravendale Drive, Mountain View, CA, 94043
Mailstop: 1127, Ph: 1-650-623-3461

On Fri, 5 Jun 2015, Ben Pfaff wrote:

> On Fri, Jun 05, 2015 at 10:48:30AM -0700, Sabyasachi Sengupta wrote:
>>
>> Use xzalloc instead of xmalloc for some key structure allocations in
>> ofproto-dpif (viz. ofproto_dpif, ofport_dpif and rule_dpif) so as to
>> prevent uninitialized values in these structures. Also add seat belts
>> around these structure allocations.
>>
>> Signed-off-by: Sabyasachi Sengupta <sabyasachi.sengupta at alcatel-lucent.com>
>
> It makes no sense to check the xmalloc() or xzalloc() return value for
> NULL.
>



More information about the dev mailing list