summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2000-03-03 14:51:30 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2000-03-03 14:51:30 +0000
commit12ea9777f89499f602effb2e7ee19f8da2c60b2a (patch)
tree014b9c0a107baeee342794c14413c29596308ada /file_io
parentaac7c0eb4239188bccf243acfe50d289de020d9f (diff)
downloadlibapr-12ea9777f89499f602effb2e7ee19f8da2c60b2a.tar.gz
OS/2: register cleanup in ap_opendir() + some minor cleanup.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59682 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/os2/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
index a39b6b717..b6dbcbe9d 100644
--- a/file_io/os2/dir.c
+++ b/file_io/os2/dir.c
@@ -61,7 +61,7 @@
#define INCL_DOS
#include <os2.h>
-ap_status_t dir_cleanup(void *thedir)
+static ap_status_t dir_cleanup(void *thedir)
{
struct dir_t *dir = thedir;
return ap_closedir(dir);
@@ -78,9 +78,14 @@ ap_status_t ap_opendir(struct dir_t **new, const char *dirname, ap_context_t *cn
thedir->cntxt = cntxt;
thedir->dirname = ap_pstrdup(cntxt, dirname);
+
+ if (thedir->dirname == NULL)
+ return APR_ENOMEM;
+
thedir->handle = 0;
thedir->validentry = FALSE;
*new = thedir;
+ ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup);
return APR_SUCCESS;
}