2002-10-15 Dmitry V. Levin * stdlib/canonicalize.c (__realpath): Check for malloc return value. --- stdlib/canonicalize.c 11 Jul 2002 16:30:44 -0000 1.22 +++ stdlib/canonicalize.c 15 Nov 2002 08:46:22 -0000 @@ -73,7 +73,16 @@ __realpath (const char *name, char *reso path_max = 1024; #endif - rpath = resolved ? __alloca (path_max) : malloc (path_max); + if (resolved) + { + rpath = __alloca (path_max); + } + else + { + rpath = malloc (path_max); + if (rpath == NULL) + return NULL; + } rpath_limit = rpath + path_max; if (name[0] != '/')