diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-02-01 10:56:15 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-02-01 11:09:57 +0100 |
commit | 94c120a34f4d77ccaa9dbe42d4d74624593b6785 (patch) | |
tree | 0358ea01703f07fc09427a38a1f548d7699e8dc0 | |
parent | 1dd3df775f0beb089d8ed6ba665ee93dd4997847 (diff) |
device: Fix possible segfault
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | device.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -429,6 +429,9 @@ device_create_default(const char *name, bool external) D(DEVICE, "Create simple device '%s'\n", name); dev = calloc(1, sizeof(*dev)); + if (!dev) + return NULL; + dev->external = external; dev->set_state = simple_device_set_state; device_init(dev, &simple_device_type, name); |