From 12ea9777f89499f602effb2e7ee19f8da2c60b2a Mon Sep 17 00:00:00 2001 From: bjh Date: Fri, 3 Mar 2000 14:51:30 +0000 Subject: 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 --- file_io/os2/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'file_io') 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 -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; } -- cgit v1.2.1