Browse Source

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

- affected when using topoh for ws/wss traffic
Daniel-Constantin Mierla 11 years ago
parent
commit
ec8fe1e7ea
1 changed files with 4 additions and 2 deletions
  1. 4 2
      forward.h

+ 4 - 2
forward.h

@@ -183,7 +183,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
 
@@ -277,9 +277,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);