diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-12-06 19:40:41 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-12-06 19:40:41 +0000 |
commit | 36f74d94607b7f47e47a39b55ac59203b570027b (patch) | |
tree | 0bc450d13d22ffa8d9700a16bd2814e54cad2630 /misc | |
parent | 4ce2793b8a47953eb9a2d8032d9736b56c3289e9 (diff) | |
download | libapr-36f74d94607b7f47e47a39b55ac59203b570027b.tar.gz |
fix apr_get_userdata(): return NULL if the userdata hash table isn't there
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60902 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-rw-r--r-- | misc/unix/start.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/unix/start.c b/misc/unix/start.c index e9eedb3d8..d589d2777 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -91,7 +91,7 @@ apr_status_t apr_set_userdata(const void *data, const char *key, { 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_set_userdata(const void *data, const char *key, 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; } |