From 1369f313d113c5aca90849e92902ce2142a0e3ed Mon Sep 17 00:00:00 2001 From: Poornima G Date: Mon, 19 Feb 2018 21:23:53 +0530 Subject: libglusterfs: Fix coverity issue FORWARD_NULL Change-Id: I1402046edb232ca9d23346db82a0cfd041c91e70 Signed-off-by: Poornima G --- libglusterfs/src/graph.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c index 738cd9688db..db80e21272a 100644 --- a/libglusterfs/src/graph.c +++ b/libglusterfs/src/graph.c @@ -1137,13 +1137,10 @@ glusterfs_graph_attach (glusterfs_graph_t *orig_graph, char *path, } file_len = stbuf.st_size; - if (file_len) { - volfile_content = GF_CALLOC (file_len+1, sizeof (char), - gf_common_mt_char); - if (!volfile_content) { - return -ENOMEM; - } - } + volfile_content = GF_CALLOC (file_len+1, sizeof (char), + gf_common_mt_char); + if (!volfile_content) + return -ENOMEM; fp = fopen (path, "r"); if (!fp) { -- cgit