summaryrefslogtreecommitdiffstats
path: root/tools/permutations.c
diff options
context:
space:
mode:
authorF. Aragon <paco@voltanet.io>2018-09-20 16:23:52 +0200
committerF. Aragon <paco@voltanet.io>2018-09-20 16:23:52 +0200
commit3b23c6c379c2b3a2f9fdbf3aec7cb5e0158c498d (patch)
tree2a9568644e4d6bb15d20f60bd3fc7f36a596063e /tools/permutations.c
parentMerge pull request #3017 from pacovn/devbuild_Wshadow_flag (diff)
downloadfrr-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.c3
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();