Browse code

perl: push the sip msg structure to perl after initializing it

- reported by David Cunningham
- backport from amster commit 341f810dca0cc0596e22f2ac1bca86de0b8d142d

Daniel-Constantin Mierla authored on 31/07/2013 11:51:34
Showing 1 changed files
... ...
@@ -131,12 +131,13 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
131 131
 	ENTER;				/* everything created after here */
132 132
 	SAVETMPS;			/* ...is a temporary variable.   */
133 133
 	PUSHMARK(SP);			/* remember the stack pointer    */
134
-	XPUSHs(m);			/* Our reference to the stack... */
135 134
 
136 135
 	m = sv_newmortal();
137 136
 	sv_setref_pv(m, "OpenSER::Message", (void *)_msg);
138 137
 	SvREADONLY_on(SvRV(m));
139 138
 
139
+	XPUSHs(m);			/* Our reference to the stack... */
140
+
140 141
 	if (mystr)
141 142
 		XPUSHs(sv_2mortal(newSVpv(mystr, strlen(mystr))));
142 143
 					/* Our string to the stack... */