eeze: Don't leak udev enumeration

If we cannot create a new udev device, then we should free the
previously created udev enumeration from above.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-12-14 07:31:39 -05:00
parent d29f01e5ee
commit 5f7d942253
1 changed files with 4 additions and 1 deletions

View File

@ -28,7 +28,10 @@ eeze_udev_find_similar_from_syspath(const char *syspath)
return NULL;
if (!(device = _new_device(syspath)))
return NULL;
{
udev_enumerate_unref(en);
return NULL;
}
vendor = udev_device_get_property_value(device, "ID_VENDOR_ID");