add two asserts to help parfait (#2530)

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2931 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Stefan Bühler 2014-01-10 12:05:09 +00:00
parent 24994e113a
commit 524e0a30a0
2 changed files with 2 additions and 0 deletions

View File

@ -170,6 +170,7 @@ void array_set_key_value(array *hdrs, const char *key, size_t key_len, const cha
data_unset *array_replace(array *a, data_unset *du) {
int ndx;
assert(NULL != du);
if (-1 == (ndx = array_get_index(a, du->key->ptr, du->key->used, NULL))) {
array_insert_unique(a, du);
return NULL;

View File

@ -1170,6 +1170,7 @@ int config_read(server *srv, const char *fn) {
}
prepends = (data_array *)configparser_merge_data((data_unset *)prepends, (data_unset *)modules);
assert(NULL != prepends);
buffer_copy_string_buffer(prepends->key, modules->key);
array_replace(srv->config, (data_unset *)prepends);
modules->free((data_unset *)modules);