summaryrefslogtreecommitdiffabout
path: root/src/variable.c
Side-by-side diff
Diffstat (limited to 'src/variable.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/variable.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/variable.c b/src/variable.c
index e6bad1a..6b23c00 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -1,21 +1,21 @@
-/* This file is part of vmod-tbf
- Copyright (C) 2013-2015 Sergey Poznyakoff
+/* This file is part of vmod-variable
+ Copyright (C) 2013-2016 Sergey Poznyakoff
- Vmod-tbf is free software; you can redistribute it and/or modify
+ Vmod-variable is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
- Vmod-tbf is distributed in the hope that it will be useful,
+ Vmod-variable is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
+ along with vmod-variable. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdlib.h>
#include <stdarg.h>
#include <syslog.h>
#include <ctype.h>
@@ -178,12 +178,15 @@ symtab_remove(struct symtab *st, const char *name)
break;
if (++i >= hash_size[st->hash_num])
i = 0;
if (i == pos)
return ENOENT;
}
+
+ if (!entry)
+ return ENOENT;
var_free(entry);
for (;;) {
st->tab[i] = NULL;
j = i;
@@ -389,12 +392,13 @@ get_symtab(VARIABLE_CTX ctx)
assert(fd >= 0);
AZ(pthread_mutex_lock(&symtab_mtx));
if (symtabc <= fd) {
size_t n = fd + 1;
symtabv = realloc(symtabv, n * sizeof(symtabv[0]));
+ AN(symtabv);
while (symtabc < n)
symtabv[symtabc++] = NULL;
}
if (!symtabv[fd])
symtabv[fd] = symtab_create();
st = symtabv[fd];

Return to:

Send suggestions and report system problems to the System administrator.