From fab6944206bf44e2260f20a9d5f1e785f933e705 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 18 Aug 2018 11:39:03 +0530 Subject: coverity: libglusterfs issues CID: 1391415, 1274122, 1274201, 1382408, 1382437, 1389436 1288798, 1288106, 1288110 updates: bz#789278 Change-Id: I48c7a50f22f5f4580310040c66463d9f7dd26204 Signed-off-by: Amar Tumballi --- libglusterfs/src/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libglusterfs/src/syscall.c') diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c index 2d79d695b09..6a17d1ec6ca 100644 --- a/libglusterfs/src/syscall.c +++ b/libglusterfs/src/syscall.c @@ -493,6 +493,8 @@ gf_add_prefix(const char *ns, const char *key, char **newkey) int ns_length = strlen(ns); *newkey = GF_MALLOC(ns_length + strlen(key) + 10, gf_common_mt_char); + if (!*newkey) + return; strcpy(*newkey, ns); strcat(*newkey, key); } else { @@ -507,6 +509,8 @@ gf_remove_prefix(const char *ns, const char *key, char **newkey) if (strncmp(key, ns, ns_length) == 0) { *newkey = GF_MALLOC(-ns_length + strlen(key) + 10, gf_common_mt_char); + if (!*newkey) + return; strcpy(*newkey, key + ns_length); } else { *newkey = gf_strdup(key); -- cgit