summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-09-09 00:46:30 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-09 06:39:15 -0700
commit3c029faaf40b53ef3be94d9ad9a927e9a5b4d72c (patch)
tree4edf3778308588268e3dcdd54eb6aa8d915d6657 /libglusterfsclient/src/libglusterfsclient.c
parent6858391d8909abeb2d396e806df49f6cd3253c20 (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/libglusterfsclient.c')
-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 5dd7fbc..e739a80 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;