summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-08-21 23:32:39 +0300
committerNiels de Vos <ndevos@redhat.com>2018-08-22 13:32:04 +0000
commit183aca0e20a2cf2923a2f56352ffa2cefb49afcc (patch)
treec8e942a27ea5cd62087a491ad3c2f9a113ac0ee0 /libglusterfs
parent12510ece4f45a54452224c048abdce4af97b68cb (diff)
libglusterfs/src/quota-common-utils.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: Ie2a634d768904636160582189a5f0390668b37bb updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/quota-common-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/quota-common-utils.c b/libglusterfs/src/quota-common-utils.c
index ad7e4dcba1c..623248f2eb6 100644
--- a/libglusterfs/src/quota-common-utils.c
+++ b/libglusterfs/src/quota-common-utils.c
@@ -106,7 +106,7 @@ quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta,
int32_t ret = -ENOMEM;
quota_meta_t *value = NULL;
- value = GF_CALLOC (1, sizeof (quota_meta_t), gf_common_quota_meta_t);
+ value = GF_MALLOC (sizeof (quota_meta_t), gf_common_quota_meta_t);
if (value == NULL) {
goto out;
}