The 'canonicalize-lgpl' module should better not rely on malloc-posix or realloc-posix, otherwise it adds extra complexity to the 'relocatable' module family. Setting errno = ENOMEM is the more maintainable solution here.
2007-09-09 Bruno Haible <[EMAIL PROTECTED]> * lib/canonicalize-lgpl.c (__realpath): Set errno to ENOMEM when malloc or realloc fails. *** lib/canonicalize-lgpl.c 9 Jun 2007 11:15:22 -0000 1.3 --- lib/canonicalize-lgpl.c 9 Sep 2007 14:30:44 -0000 *************** *** 135,141 **** { rpath = malloc (path_max); if (rpath == NULL) ! return NULL; } else rpath = resolved; --- 135,146 ---- { rpath = malloc (path_max); if (rpath == 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; *************** *** 209,215 **** new_size += path_max; new_rpath = (char *) realloc (rpath, new_size); if (new_rpath == NULL) ! goto error; rpath = new_rpath; rpath_limit = rpath + new_size; --- 214,225 ---- new_size += path_max; new_rpath = (char *) realloc (rpath, new_size); if (new_rpath == NULL) ! { ! /* 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;