Browse code

core: route(dynamic expression) memleak fix

When using a dynamic expression as argument to route() (e.g.
route($foo) or route($foo + "1")), the evaluated rvalue was not
freed.

Andrei Pelinescu-Onciul authored on 29/09/2010 14:27:46
Showing 1 changed files
... ...
@@ -680,11 +680,13 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
680 680
 				if (unlikely(i < 0)) {
681 681
 					ERR("route \"%s\" not found at %s:%d\n",
682 682
 							s.s, (a->cfile)?a->cfile:"line", a->cline);
683
+					rval_destroy(rv);
683 684
 					rval_cache_clean(&c1);
684 685
 					s.s = 0;
685 686
 					ret = E_SCRIPT;
686 687
 					goto error;
687 688
 				}
689
+				rval_destroy(rv);
688 690
 				rval_cache_clean(&c1);
689 691
 				s.s = 0;
690 692
 			} else {