diff options
author | F. Aragon <paco@voltanet.io> | 2018-09-20 16:23:52 +0200 |
---|---|---|
committer | F. Aragon <paco@voltanet.io> | 2018-09-20 16:23:52 +0200 |
commit | 3b23c6c379c2b3a2f9fdbf3aec7cb5e0158c498d (patch) | |
tree | 2a9568644e4d6bb15d20f60bd3fc7f36a596063e /tools/permutations.c | |
parent | Merge pull request #3017 from pacovn/devbuild_Wshadow_flag (diff) | |
download | frr-3b23c6c379c2b3a2f9fdbf3aec7cb5e0158c498d.tar.xz frr-3b23c6c379c2b3a2f9fdbf3aec7cb5e0158c498d.zip |
tools: null check (Coverity 1399484)
Fixed using XCALLOC(MTYPE_TMP, ...) instead of calloc(...) because of the
error handling (XCALLOC checks + log + abort through memory_oom())
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to '')
-rw-r--r-- | tools/permutations.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/permutations.c b/tools/permutations.c index c5109dc3e..f51d4a4ec 100644 --- a/tools/permutations.c +++ b/tools/permutations.c @@ -39,7 +39,8 @@ int main(int argc, char *argv[]) fprintf(stdout, USAGE "\n"); exit(EXIT_SUCCESS); } - struct cmd_element *cmd = calloc(1, sizeof(struct cmd_element)); + struct cmd_element *cmd = XCALLOC(MTYPE_TMP, + sizeof(struct cmd_element)); cmd->string = strdup(argv[1]); struct graph *graph = graph_new(); |