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 <ykaul@redhat.com>
This commit is contained in:
Yaniv Kaul 2018-08-21 23:31:47 +03:00 committed by Amar Tumballi
parent dad85784e7
commit 5ab6e2ce11

View File

@ -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;