]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix memory leak on memory error
authorTravis Cross <tc@traviscross.com>
Wed, 9 Apr 2014 07:14:59 +0000 (07:14 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 9 Apr 2014 18:41:02 +0000 (18:41 +0000)
In the event of a memory error, we were trying to free a null pointer
while leaking the allocation for field_expanded_alloc.

src/switch_ivr_play_say.c

index 14d370333810f7df1dfc62c7943bfd7cb0b9e7b3..813a109aac73bb3839393160a9e2bb25f40cb3eb 100644 (file)
@@ -227,7 +227,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
                                                if (!(substituted = malloc(len))) {
                                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Memory Error!\n");
                                                        switch_regex_safe_free(re);
-                                                       switch_safe_free(expanded);
+                                                       switch_safe_free(field_expanded_alloc);
                                                        goto done;
                                                }
                                                memset(substituted, 0, len);