diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2016-11-23 12:06:34 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2016-12-01 18:45:30 +0100 |
| commit | b5a1e9ef5c7b1e505e6d82ea9c542748005afe63 (patch) | |
| tree | e5384d149fa22ce108893beba8811984912024a9 /lib/command.c | |
| parent | e9484f70b21ed49d0ca6dbf2899b3a6306ffd2e9 (diff) | |
lib: remove misleading copy/del_cmd_element
struct cmd_element items are static global variables, they are never
allocated, copied or freed.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/command.c b/lib/command.c index 3ad0ca92d7..85053aaa8a 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2446,27 +2446,6 @@ copy_cmd_token (struct cmd_token *token) } void -del_cmd_element(struct cmd_element *cmd) -{ - if (!cmd) return; - free ((char *) cmd->string); - free ((char *) cmd->doc); - free (cmd); -} - -struct cmd_element * -copy_cmd_element(const struct cmd_element *cmd) -{ - struct cmd_element *el = XMALLOC(MTYPE_CMD_TOKENS, sizeof (struct cmd_element)); - el->string = cmd->string ? XSTRDUP(MTYPE_CMD_TOKENS, cmd->string) : NULL; - el->func = cmd->func; - el->doc = cmd->doc ? XSTRDUP(MTYPE_CMD_TOKENS, cmd->doc) : NULL; - el->daemon = cmd->daemon; - el->attr = cmd->attr; - return el; -} - -void cmd_terminate () { struct cmd_node *cmd_node; |
