fix: Removal of unnecessary item->cmd NULL check.
This commit is contained in:
1 parent
3a822ccb0c
commit
04c7cdd33a
1 file changed
+1
-7
@@ -58,13 +58,7 @@ static struct cmditem* newItem(char* cmd)
|
||||
ERL_ERROR " atInit: "
|
||||
"failed to allocate memory for cmditem");
|
||||
item->cmd = (char*)(item + 1);
|
||||
memcpy(item->cmd, cmd, strlen(cmd) + 1);
|
||||
|
||||
if (item->cmd == NULL) {
|
||||
free(item);
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
strlcpy(item->cmd, cmd, strlen(cmd) + 1);
|
||||
|
||||
ellAdd(&s_cmdlist, &item->node);
|
||||
|
||||
|
||||
Reference in new issue
Block a user