aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-02-06 20:52:31 +0100
committerKristian Evers <kristianevers@gmail.com>2018-02-06 21:30:42 +0100
commit27200f2f7689cb77546efb2e3ba0e795c46fd45f (patch)
tree644f0a06a88e51aac97bf84cb77c0c579349fb80
parent3dfd8b26d30f5b1acd189154b830eceb6ac38ccb (diff)
downloadPROJ-27200f2f7689cb77546efb2e3ba0e795c46fd45f.tar.gz
PROJ-27200f2f7689cb77546efb2e3ba0e795c46fd45f.zip
Make pj_free return with the correct errno.
Error codes can't be specified directly in pj_free. With this change the error number in proj_errno() is passed on to P->destructor to ensure that we communicate the correct reason why the PJ object is being freed. This was a problem in the cs2cs_emulation setup when auxillary operations failed to create. The error was not propagated properly when destroying the parent object.
-rw-r--r--src/pj_malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pj_malloc.c b/src/pj_malloc.c
index cfb7f658..73a60599 100644
--- a/src/pj_malloc.c
+++ b/src/pj_malloc.c
@@ -182,7 +182,7 @@ void pj_free(PJ *P) {
/* to be called as the last step of the local destructor */
/* pointed to by P->destructor. In most cases, */
/* pj_default_destructor actually *is* what is pointed to */
- P->destructor (P, 0);
+ P->destructor (P, proj_errno(P));
}