+2007-09-09 Bruno Haible <bruno@clisp.org>
+
+ * lib/canonicalize-lgpl.c (__realpath): Set errno to ENOMEM when
+ malloc or realloc fails.
+
2007-09-09 Bruno Haible <bruno@clisp.org>
* modules/getcwd (Depends-on): Add malloc-posix.
{
rpath = malloc (path_max);
if (rpath == NULL)
- return NULL;
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' gnulib module. */
+ errno = ENOMEM;
+ return NULL;
+ }
}
else
rpath = resolved;
new_size += path_max;
new_rpath = (char *) realloc (rpath, new_size);
if (new_rpath == NULL)
- goto error;
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'realloc-posix' gnulib module. */
+ errno = ENOMEM;
+ goto error;
+ }
rpath = new_rpath;
rpath_limit = rpath + new_size;