Commit 2209c0f8 authored by Tom Lane's avatar Tom Lane

Preserve errno across free().

Dept. of second thoughts: free() isn't guaranteed not to change errno.
Make sure we report the right error if getcwd() fails.
parent 9aca5125
...@@ -608,7 +608,10 @@ make_absolute_path(const char *path) ...@@ -608,7 +608,10 @@ make_absolute_path(const char *path)
} }
else else
{ {
int save_errno = errno;
free(buf); free(buf);
errno = save_errno;
#ifndef FRONTEND #ifndef FRONTEND
elog(ERROR, "could not get current working directory: %m"); elog(ERROR, "could not get current working directory: %m");
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment