mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
fix leak and make static or dynamic head obj possible
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15972 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1125,6 +1125,10 @@ SWITCH_DECLARE(void) switch_console_free_matches(switch_console_callback_match_t
|
||||
free(cur->val);
|
||||
free(cur);
|
||||
}
|
||||
|
||||
if (my_match->dynamic) {
|
||||
free(my_match);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_console_push_match(switch_console_callback_match_t **matches, const char *new_val)
|
||||
@@ -1133,6 +1137,7 @@ SWITCH_DECLARE(void) switch_console_push_match(switch_console_callback_match_t *
|
||||
|
||||
if (!*matches) {
|
||||
switch_zmalloc(*matches, sizeof(**matches));
|
||||
(*matches)->dynamic = 1;
|
||||
}
|
||||
|
||||
switch_zmalloc(match, sizeof(*match));
|
||||
|
Reference in New Issue
Block a user