gstein 00/12/06 11:40:43
Modified: misc/unix start.c
Log:
fix apr_get_userdata(): return NULL if the userdata hash table isn't there
Revision Changes Path
1.43 +5 -2 apr/misc/unix/start.c
Index: start.c
===================================================================
RCS file: /home/cvs/apr/misc/unix/start.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -u -r1.42 -r1.43
--- start.c 2000/12/03 00:06:48 1.42
+++ start.c 2000/12/06 19:40:41 1.43
@@ -91,7 +91,7 @@
{
int keylen = strlen(key);
- if (!cont->prog_data)
+ if (cont->prog_data == NULL)
cont->prog_data = apr_make_hash(cont);
if (apr_hash_get(cont->prog_data, key, keylen) == NULL){
@@ -108,7 +108,10 @@
apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont)
{
- (*data) = apr_hash_get(cont->prog_data, key, strlen(key));
+ if (cont->prog_data == NULL)
+ *data = NULL;
+ else
+ *data = apr_hash_get(cont->prog_data, key, strlen(key));
return APR_SUCCESS;
}