diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-02-01 10:56:28 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-02-01 11:09:58 +0100 |
commit | fa624787a83347039ff690ec0a8e209fd1642c2e (patch) | |
tree | 3d1a07d94287be95e5765c892b9abc031a33a1a9 | |
parent | fb9beaa4d0d70300ea00b92f246f7edc08e9da5d (diff) |
alias: Fix possible segfault
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | alias.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -112,6 +112,9 @@ alias_device_create(const char *name, struct blob_attr *attr) struct alias_device *alias; alias = calloc(1, sizeof(*alias) + strlen(name) + 1); + if (!alias) + return NULL; + strcpy(alias->name, name); alias->dev.set_state = alias_device_set_state; alias->dev.hidden = true; |