summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-09-09 00:39:11 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-09 06:38:50 -0700
commit19f3591e4ac291d48252849e03afd2ac77205316 (patch)
tree5a5c0c8bfbe4899526466fde0c98c2c35ca976e1 /libglusterfsclient/src
parentbc94b7e77fffcbcde8f838cae8fee552d5bd1189 (diff)
libglusterfsclient: Handle CALLOC failure in libgf_client_lookup
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 253 (Global bug for libglusterfsclient NULL checks and CALLOC handling fixes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=253
Diffstat (limited to 'libglusterfsclient/src')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 6860e1e36..b53883617 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -1937,6 +1937,13 @@ libgf_client_lookup (libglusterfs_client_ctx_t *ctx,
inode_t *inode = NULL;
local = CALLOC (1, sizeof (*local));
+ if (!local) {
+ gf_log (LIBGF_XL_NAME, GF_LOG_ERROR, "Memory allocation"
+ " failed");
+ errno = ENOMEM;
+ return -1;
+ }
+
if (loc->inode) {
local->fop.lookup.is_revalidate = 1;
loc->ino = loc->inode->ino;