From 5ab6e2ce11cad6034f4209ffc63c110951fd647a Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Tue, 21 Aug 2018 23:31:47 +0300 Subject: cli/src/cli-cmd-parser.c:move to GF_MALLOC() instead of GF_CALLOC() when It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! Change-Id: I01c67fd535ea4a2b8fa7cb4d89bff52642dc009a updates: bz#1193929 Signed-off-by: Yaniv Kaul --- cli/src/cli-cmd-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 5472b3e8f38..21d9b7d2eb4 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2638,7 +2638,7 @@ config_parse (const char **words, int wordcount, dict_t *dict, /* trailing strcat will add two bytes, make space for that */ append_len++; - append_str = GF_CALLOC (1, append_len, cli_mt_append_str); + append_str = GF_MALLOC (append_len, cli_mt_append_str); if (!append_str) { ret = -1; goto out; -- cgit