Browse code

core: hanlde replacement buffer free for WS/WSS frame sending

- affected when using topoh for ws/wss traffic

Daniel-Constantin Mierla authored on 16/09/2014 21:33:20
Showing 1 changed files
... ...
@@ -183,7 +183,7 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
183 183
 		wsev.id = con->id;
184 184
 		ret = sr_event_exec(SREV_TCP_WS_FRAME_OUT, (void *) &wsev);
185 185
 		tcpconn_put(con);
186
-		return ret;
186
+		goto done;
187 187
 	}
188 188
 #endif
189 189
 
... ...
@@ -277,9 +277,11 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
277 277
 			LOG(L_CRIT, "BUG: msg_send: unknown proto %d\n", dst->proto);
278 278
 			goto error;
279 279
 	}
280
+	ret = 0;
281
+done:
280 282
 	if(outb.s != buf)
281 283
 		pkg_free(outb.s);
282
-	return 0;
284
+	return ret;
283 285
 error:
284 286
 	if(outb.s != buf)
285 287
 		pkg_free(outb.s);