evapi: free the faked msg clone used for dispatcher event route
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 15 Aug 2019 06:33:49 +0000 (08:33 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 15 Aug 2019 06:33:49 +0000 (08:33 +0200)
src/modules/evapi/evapi_dispatch.c

index ec56945..e603753 100644 (file)
@@ -37,6 +37,7 @@
 #include "../../core/dprint.h"
 #include "../../core/ut.h"
 #include "../../core/cfg/cfg_struct.h"
+#include "../../core/receive.h"
 #include "../../core/kemi.h"
 #include "../../core/fmsg.h"
 
@@ -170,6 +171,9 @@ int evapi_run_cfg_route(evapi_env_t *evenv, int rt, str *rtname)
        }
        set_route_type(backup_rt);
        evapi_set_msg_env(fmsg, NULL);
+       /* free the structure -- it is a clone of faked msg */
+       free_sip_msg(fmsg);
+       ksr_msg_env_reset();
        return 0;
 }