X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fcanonicalize-lgpl.c;h=2ed149bcb0ac9fbb641ed8a8fb59aa18a8f856ce;hb=d5d3e86d326de4aa7d661fde1ebb636f3efbffd5;hp=14dd536dc469dd9deb2d3125b56a3e735eaa1380;hpb=90988ede07abd2e58283d5e06b1b69f74b6967d2;p=gnulib.git diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 14dd536dc..2ed149bcb 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -135,7 +135,12 @@ __realpath (const char *name, char *resolved) { 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; @@ -209,7 +214,12 @@ __realpath (const char *name, char *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;