summaryrefslogtreecommitdiff
path: root/dso
diff options
context:
space:
mode:
authordougm <dougm@13f79535-47bb-0310-9956-ffa450edef68>2000-06-25 22:48:18 +0000
committerdougm <dougm@13f79535-47bb-0310-9956-ffa450edef68>2000-06-25 22:48:18 +0000
commit4102c54ddca8ccf0be65912d356a1c1f5b70763b (patch)
treec35f3e8ceefbc47a9585fa1ccc0cbe5508e8a5ab /dso
parenteed3635de8dd90492ea45cdabfdd60b861753096 (diff)
downloadlibapr-4102c54ddca8ccf0be65912d356a1c1f5b70763b.tar.gz
allocate *res_handle before setting (*res_handle)->errormsg
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60252 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso')
-rw-r--r--dso/unix/dso.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dso/unix/dso.c b/dso/unix/dso.c
index 6f09a0112..8892a7dff 100644
--- a/dso/unix/dso.c
+++ b/dso/unix/dso.c
@@ -72,6 +72,8 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
#endif
+ *res_handle = ap_pcalloc(ctx, sizeof(**res_handle));
+
if(os_handle == NULL) {
#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
(*res_handle)->errormsg = strerror(errno);
@@ -82,7 +84,6 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path,
#endif
}
- *res_handle = ap_pcalloc(ctx, sizeof(**res_handle));
(*res_handle)->handle = (void*)os_handle;
(*res_handle)->cont = ctx;
(*res_handle)->errormsg = NULL;