From: Hans Dedecker Date: Mon, 1 Feb 2016 09:56:28 +0000 (+0100) Subject: alias: Fix possible segfault X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fa624787a83347039ff690ec0a8e209fd1642c2e;p=project%2Fnetifd.git alias: Fix possible segfault Signed-off-by: Hans Dedecker --- diff --git a/alias.c b/alias.c index 01bec41..1f23da0 100644 --- a/alias.c +++ b/alias.c @@ -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;