summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2018-02-19 21:23:53 +0530
committerJeff Darcy <jeff@pl.atyp.us>2018-03-02 19:38:45 +0000
commit1369f313d113c5aca90849e92902ce2142a0e3ed (patch)
tree537e437d66a78475a0f54271a7eb66df36c6a148 /libglusterfs
parentfecb0fc748806d4e6d61bcbef976acf473e55c82 (diff)
libglusterfs: Fix coverity issue FORWARD_NULL
Change-Id: I1402046edb232ca9d23346db82a0cfd041c91e70 Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/graph.c11
1 files changed, 4 insertions, 7 deletions
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) {