aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c
index 554da57d8..21b4ea9aa 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1423,7 +1423,11 @@ int __ast_string_field_init(struct ast_string_field_mgr *mgr, struct ast_string_
return add_string_pool(mgr, pool_head, needed, file, lineno, func);
}
if (needed < 0) { /* reset all pools */
- /* nothing to do */
+ if (*pool_head == NULL) {
+ ast_log(LOG_WARNING, "trying to reset empty pool\n");
+ return -1;
+ }
+ cur = *pool_head;
} else { /* preserve the last pool */
if (*pool_head == NULL) {
ast_log(LOG_WARNING, "trying to reset empty pool\n");