summaryrefslogtreecommitdiffstats
path: root/xlators/debug/io-stats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-05-25 09:00:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-27 02:00:37 -0700
commit665591074fbef562b48a9cd1b74b3d4cc92cd667 (patch)
treeca6f27348cd833048c70a07344d166a154001f96 /xlators/debug/io-stats
parent419ff2e73983efc5b31e98795e99ab4fdff41e6e (diff)
Check whether NULL is returned after GF_CALLOC in the init function of io-stats
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 946 (Null check in init function of io-stats) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=946
Diffstat (limited to 'xlators/debug/io-stats')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index f5787a710c8..ee9c29e69a0 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -1435,6 +1435,12 @@ init (xlator_t *this)
conf = GF_CALLOC (1, sizeof(*conf), gf_io_stats_mt_ios_conf);
+ if (!conf) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Out of memory.");
+ return -1;
+ }
+
LOCK_INIT (&conf->lock);
gettimeofday (&conf->cumulative.started_at, NULL);