projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9aca512
)
Preserve errno across free().
author
Tom Lane
<
[email protected]
>
Fri, 4 Apr 2014 23:07:37 +0000
(19:07 -0400)
committer
Tom Lane
<
[email protected]
>
Fri, 4 Apr 2014 23:07:37 +0000
(19:07 -0400)
Dept. of second thoughts: free() isn't guaranteed not to change errno.
Make sure we report the right error if getcwd() fails.
src/port/path.c
patch
|
blob
|
blame
|
history
diff --git
a/src/port/path.c
b/src/port/path.c
index 438b52960423bfec077e78e7d80246fffa4899ac..3484f2cb6155fc7865adc4c3e4d807a661793ddc 100644
(file)
--- a/
src/port/path.c
+++ b/
src/port/path.c
@@
-608,7
+608,10
@@
make_absolute_path(const char *path)
}
else
{
+ int save_errno = errno;
+
free(buf);
+ errno = save_errno;
#ifndef FRONTEND
elog(ERROR, "could not get current working directory: %m");
#else