diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/variable.c | 14 |
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,18 +1,18 @@ | |||
1 | /* This file is part of vmod-tbf | 1 | /* This file is part of vmod-variable |
2 | Copyright (C) 2013-2015 Sergey Poznyakoff | 2 | Copyright (C) 2013-2016 Sergey Poznyakoff |
3 | 3 | ||
4 | Vmod-tbf is free software; you can redistribute it and/or modify | 4 | Vmod-variable is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; either version 3, or (at your option) | 6 | the Free Software Foundation; either version 3, or (at your option) |
7 | any later version. | 7 | any later version. |
8 | 8 | ||
9 | Vmod-tbf is distributed in the hope that it will be useful, | 9 | Vmod-variable is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | GNU General Public License for more details. | 12 | GNU General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
15 | along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. | 15 | along with vmod-variable. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | #include <config.h> | 17 | #include <config.h> |
18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
@@ -182,6 +182,9 @@ symtab_remove(struct symtab *st, const char *name) | |||
182 | return ENOENT; | 182 | return ENOENT; |
183 | } | 183 | } |
184 | 184 | ||
185 | if (!entry) | ||
186 | return ENOENT; | ||
187 | |||
185 | var_free(entry); | 188 | var_free(entry); |
186 | 189 | ||
187 | for (;;) { | 190 | for (;;) { |
@@ -392,6 +395,7 @@ get_symtab(VARIABLE_CTX ctx) | |||
392 | if (symtabc <= fd) { | 395 | if (symtabc <= fd) { |
393 | size_t n = fd + 1; | 396 | size_t n = fd + 1; |
394 | symtabv = realloc(symtabv, n * sizeof(symtabv[0])); | 397 | symtabv = realloc(symtabv, n * sizeof(symtabv[0])); |
398 | AN(symtabv); | ||
395 | while (symtabc < n) | 399 | while (symtabc < n) |
396 | symtabv[symtabc++] = NULL; | 400 | symtabv[symtabc++] = NULL; |
397 | } | 401 | } |