summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/graph.l
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/graph.l')
-rw-r--r--libglusterfs/src/graph.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/libglusterfs/src/graph.l b/libglusterfs/src/graph.l
index 8d9d2dc3611..f7a02e48107 100644
--- a/libglusterfs/src/graph.l
+++ b/libglusterfs/src/graph.l
@@ -45,12 +45,14 @@ void append_string(const char *str, int size)
} else {
text = GF_REALLOC (text, new_size);
}
- if (!text)
+ if (!text) {
gf_log ("parser", GF_LOG_ERROR,
"out of memory");
+ return;
+ }
text_asize = new_size;
}
- memcpy(text + text_size, str, size);
+ memcpy(text + text_size, str, size);
text_size += size;
text[text_size] = 0;
}