mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-06 01:45:11 +00:00
Merged revisions 131717 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r131717 | bbryant | 2008-07-17 13:14:42 -0500 (Thu, 17 Jul 2008) | 8 lines Fix a memory leak in register_group_feature when attempting to register a feature without specifying a group or feature to register. (closes issue #13101) Reported by: eliel Patches: features.c.patch uploaded by eliel (license 64) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@131718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1330,14 +1330,6 @@ static void register_group_feature(struct feature_group *fg, const char *exten,
|
||||
{
|
||||
struct feature_group_exten *fge;
|
||||
|
||||
if (!(fge = ast_calloc(1, sizeof(*fge))))
|
||||
return;
|
||||
|
||||
if (ast_string_field_init(fge, 128)) {
|
||||
ast_free(fge);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fg) {
|
||||
ast_log(LOG_NOTICE, "You didn't pass a group!\n");
|
||||
return;
|
||||
@@ -1348,7 +1340,15 @@ static void register_group_feature(struct feature_group *fg, const char *exten,
|
||||
return;
|
||||
}
|
||||
|
||||
ast_string_field_set(fge, exten, (ast_strlen_zero(exten) ? feature->exten : exten));
|
||||
if (!(fge = ast_calloc(1, sizeof(*fge))))
|
||||
return;
|
||||
|
||||
if (ast_string_field_init(fge, 128)) {
|
||||
ast_free(fge);
|
||||
return;
|
||||
}
|
||||
|
||||
ast_string_field_set(fge, exten, S_OR(exten, feature->exten));
|
||||
|
||||
fge->feature = feature;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user