evas_smart: Add a check for zero size before malloc
authorVaibhav Gupta <g.vaibhav1@samsung.com>
Fri, 12 Jun 2015 08:47:13 +0000 (09:47 +0100)
committerTom Hacohen <tom@stosb.com>
Fri, 12 Jun 2015 08:47:13 +0000 (09:47 +0100)
commita1545ec314776d40f08486221aca37eb8073176e
treef84ef1ff269359cd6d0aebd8520d2d51a0d03647
parent8f0b8a9060df26032b2f4388cb21406ff10abeac
evas_smart: Add a check for zero size before malloc

Summary:
Size may be zero while allocating interfaces private data,
when NULL is passed in EVAS_SMART_SUBCLASS_IFACE_NEW for ifaces argument.

If size is 0, then malloc() returns either NULL, or a unique pointer
value that can later be successfully passed to free(). It is implementation
dependent. This case would be likely to occur in case of smart classes with
no interfaces.

@fix

Signed-off-by: Vaibhav Gupta <g.vaibhav1@samsung.com>
Reviewers: raster, Hermet, tasn, cedric

Subscribers: SanghyeonLee, sachin.dev, singh.amitesh, cedric

Differential Revision: https://phab.enlightenment.org/D2679
src/lib/evas/canvas/evas_object_smart.c