summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libudev/libudev-enumerate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index 172965511b..6a5f4e025e 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -81,6 +81,8 @@ _public_ struct udev_enumerate *udev_enumerate_new(struct udev *udev)
{
struct udev_enumerate *udev_enumerate;
+ if (udev == NULL)
+ return NULL;
udev_enumerate = calloc(1, sizeof(struct udev_enumerate));
if (udev_enumerate == NULL)
return NULL;