diff options
| author | Raghavendra G <raghavendra@gluster.com> | 2009-09-01 00:24:49 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-08 03:23:29 -0700 | 
| commit | 1d47c41f048194cd754d97391b5c490446fe6fa2 (patch) | |
| tree | b585bae4d1b645520239ea7a0f26577578835da2 /libglusterfsclient/src/libglusterfsclient.c | |
| parent | 83a245fda0739a5ed4253fe2c701ca58061f5324 (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/src/libglusterfsclient.c')
| -rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index dc46c167d87..66300b26424 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -6843,6 +6843,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)                                  {  | 
