[ovs-discuss] No check for memory allocation from malloc()

Ben Pfaff blp at nicira.com
Wed Sep 16 15:36:09 UTC 2015


I sent a patch for review:
        http://openvswitch.org/pipermail/dev/2015-September/060110.html

On Tue, Sep 15, 2015 at 12:33:03PM -0700, Neil McKee wrote:
> In OVS a callback fn is given to the sFlow library for all allocation,  but
> the callback (ofproto/ofproto-dpif-sflow.c:sflow_agent_alloc_cb()) just
> calls "calloc()" too.  This should probably be changed to xcalloc() as
> defined in lib/util.c which does the right thing.   Thanks for pointing
> this out.
> 
> Neil
> 
> 
> ------
> Neil McKee
> InMon Corp.
> http://www.inmon.com
> 
> On Tue, Sep 15, 2015 at 12:13 PM, neeraj mehta <mehtaneeraj07 at gmail.com>
> wrote:
> 
> > Hi Team,
> >
> > I was looking a the code in sfow_agent.c file in sflAlloc( ) function.
> > This funtion allocates memory via malloc but didn't check whether memory
> > allocation is successful or not.
> > I think there should be a check, in case malloc fails to allocate memory.
> >
> > Regards
> > Neeraj
> >
> > _______________________________________________
> > discuss mailing list
> > discuss at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/discuss
> >
> >

> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> http://openvswitch.org/mailman/listinfo/discuss




More information about the discuss mailing list