From 27200f2f7689cb77546efb2e3ba0e795c46fd45f Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 6 Feb 2018 20:52:31 +0100 Subject: 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. --- src/pj_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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)); } -- cgit v1.2.3