diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 14:56:57 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-28 14:56:57 +0000 |
commit | af793f6c8d79ca54a1de528e63e15dfe611c00a7 (patch) | |
tree | 95ac33fc88ffefbce4c2fcc494dd26354aa07b88 /main | |
parent | 8955b842fab1bf96cc39126ac837d8ae525528d2 (diff) |
Merged revisions 197538 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r197538 | file | 2009-05-28 11:51:43 -0300 (Thu, 28 May 2009) | 5 lines
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/branches/1.6.2@197542 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-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 c1e63f972..4f58b865f 100644 --- a/main/utils.c +++ b/main/utils.c @@ -1530,7 +1530,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"); |