diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 23:31:47 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-23 09:27:59 +0000 |
commit | 5ab6e2ce11cad6034f4209ffc63c110951fd647a (patch) | |
tree | 42972bcdd019ecb31ed2e2c076c29baad34f417d /cli | |
parent | dad85784e74493158a186536d6c13183c83fc658 (diff) |
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>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |