From 753146c0ff4b1b55892b71b36d6ca97797867aaa Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 27 Jul 2010 11:13:32 +0000 Subject: some check added to the variables after GF_CALLOC handles some NULL dereference problems (reported by clang when ran with code where '#define GF_CALLOC NULL'). Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 966 (NULL check for avoiding NULL dereferencing of pointers..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=966 --- xlators/protocol/legacy/server/src/server-protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/protocol/legacy/server') diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c index 839c6a55745..e6c668d1567 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.c +++ b/xlators/protocol/legacy/server/src/server-protocol.c @@ -4914,7 +4914,8 @@ _volfile_update_checksum (xlator_t *this, char *key, uint32_t checksum) if (!temp_volfile) { temp_volfile = GF_CALLOC (1, sizeof (struct _volfile_ctx), gf_server_mt_volfile_ctx); - + if (!temp_volfile) + goto out; temp_volfile->next = conf->volfile; temp_volfile->key = (key)? gf_strdup (key): NULL; temp_volfile->checksum = checksum; -- cgit