From ea8a20f3e68d5ccade465b60d98030c0c1bb4426 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 1 Sep 2009 00:19:57 +0000 Subject: libglusterfsclient: check for memory allocation failure in glusterfs_glh_realpath. Signed-off-by: Anand V. Avati BUG: 235 (Handle failures in glusterfs_glh_realpath appropriately) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=235 --- libglusterfsclient/src/libglusterfsclient.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index eaa11376f71..ee01ab19581 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) { -- cgit