diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-09-09 00:39:11 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-09 06:38:50 -0700 |
commit | 19f3591e4ac291d48252849e03afd2ac77205316 (patch) | |
tree | 5a5c0c8bfbe4899526466fde0c98c2c35ca976e1 | |
parent | bc94b7e77fffcbcde8f838cae8fee552d5bd1189 (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
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 7 |
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; |