]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_voicemail] vm_fsdb_msg_email command leaks xml object.
authorAndrey Volk <andywolk@gmail.com>
Mon, 7 Oct 2019 19:47:35 +0000 (23:47 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 30 Dec 2019 20:48:01 +0000 (00:48 +0400)
src/mod/applications/mod_voicemail/mod_voicemail.c

index ff12ebdc3baf73dd12342ed910f368eaba5642b8..6ef8bf37e7693a5feb8df0dbcb77f03316233479 100644 (file)
@@ -5979,7 +5979,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_email_function)
 
        if (switch_xml_locate_user_merged("id", id, domain, NULL, &x_user, NULL) != SWITCH_STATUS_SUCCESS) {
                stream->write_function(stream, "-ERR Can't locate user.\n");
-               switch_xml_free(x_user);
                goto done;
        }
 
@@ -6106,6 +6105,10 @@ SWITCH_STANDARD_API(vm_fsdb_msg_email_function)
 done:
        switch_core_destroy_memory_pool(&pool);
 
+       if (x_user) {
+               switch_xml_free(x_user);
+       }
+
        return SWITCH_STATUS_SUCCESS;
 }