Browse Source

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

- affected when using topoh for ws/wss traffic

(cherry picked from commit ec8fe1e7ea904a51ca933d0b15408ca464002cbe)
(cherry picked from commit b58b5fd3c8c2f9cef6362f7f069bad7f814475ca)
Daniel-Constantin Mierla 11 years ago
parent
commit
6d8fd9772b
1 changed files with 4 additions and 2 deletions
  1. 4 2
      forward.h

+ 4 - 2
forward.h

@@ -181,7 +181,7 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
 		wsev.id = con->id;
 		ret = sr_event_exec(SREV_TCP_WS_FRAME_OUT, (void *) &wsev);
 		tcpconn_put(con);
-		return ret;
+		goto done;
 	}
 #endif
 
@@ -275,9 +275,11 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
 			LOG(L_CRIT, "BUG: msg_send: unknown proto %d\n", dst->proto);
 			goto error;
 	}
+	ret = 0;
+done:
 	if(outb.s != buf)
 		pkg_free(outb.s);
-	return 0;
+	return ret;
 error:
 	if(outb.s != buf)
 		pkg_free(outb.s);