diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 14:51:43 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 14:51:43 +0000 |
commit | 167f60f98e0d52a448225a5234fe58eaf1e4edd5 (patch) | |
tree | 3c7e5cb3ca22586da2db70da05d73c1a9d3a3bff /main/utils.c | |
parent | a22b4735e5a6b8745a4915a260995886c56c7ffe (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: http://svn.digium.com/svn/asterisk/trunk@197538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/utils.c')
-rw-r--r-- | main/utils.c | 6 |
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; |