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 | dc790ba83d9ff3b0fa31993bea7682e720f3023b (diff) | |
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 'tools/permutations.c')
| -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 c5109dc3e8..f51d4a4ec9 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(); |
