Summary:
if `net` equals zero and `device` has allocated properly at the same time, memory leaks.
this patch fixes it.
Reviewers: Hermet, bu5hm4n, zmike
Reviewed By: Hermet
Subscribers: vtorri, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D12221
Change-Id: Ie70eb0da84b29c23d3192f03bb09d6a6593381e4
}
if (!device) return NULL;
net = calloc(1, sizeof(Eeze_Net));
- if (!net) return NULL;
+ if (!net)
+ {
+ udev_device_unref(device);
+ return NULL;
+ }
EINA_REFCOUNT_INIT(net);
net->device = device;
net->syspath = syspath;