summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2009-05-28 14:51:43 +0000
committerJoshua Colp <jcolp@digium.com>2009-05-28 14:51:43 +0000
commite960f0da90803cbbd4f227af68c954c1d5c83925 (patch)
tree3c7e5cb3ca22586da2db70da05d73c1a9d3a3bff /main
parentf22962a0c1973a867893bc144e5bd1bd44053a84 (diff)
Fix a bug in stringfields where it did not actually free the pools of memory.
(closes issue #15074) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 59a29ce5a..fe2d083d5 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1560,7 +1560,11 @@ int __ast_string_field_init(struct ast_string_field_mgr *mgr, struct ast_string_
}
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 if (mgr->embedded_pool) { /* preserve the embedded pool */
preserve = mgr->embedded_pool;
cur = *pool_head;