summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-09-01 00:19:57 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 03:22:49 -0700
commitea8a20f3e68d5ccade465b60d98030c0c1bb4426 (patch)
treedd7c17f08c834b7ae24ebdd236e81efdde20e01e /libglusterfsclient
parentb27afdea5d8c594e160a099e2dd814fa33529276 (diff)
libglusterfsclient: check for memory allocation failure in glusterfs_glh_realpath.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 235 (Handle failures in glusterfs_glh_realpath appropriately) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=235
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index eaa11376f..ee01ab195 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -6837,6 +6837,10 @@ glusterfs_glh_realpath (glusterfs_handle_t handle, const char *path,
if (S_ISLNK (stbuf.st_mode)) {
buf = calloc (1, path_max);
+ if (buf == NULL) {
+ errno = ENOMEM;
+ goto err;
+ }
if (++num_links > MAXSYMLINKS)
{