summaryrefslogtreecommitdiff
path: root/src/libudev/libudev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libudev/libudev.c')
-rw-r--r--src/libudev/libudev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index 57ce749e07..d8e13288b0 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -97,8 +97,10 @@ _public_ struct udev *udev_new(void) {
_cleanup_fclose_ FILE *f = NULL;
udev = new0(struct udev, 1);
- if (udev == NULL)
+ if (!udev) {
+ errno = -ENOMEM;
return NULL;
+ }
udev->refcount = 1;
f = fopen("/etc/udev/udev.conf", "re");