mirror of
https://github.com/EndPositive/slipstream.git
synced 2025-10-08 12:25:04 +00:00
Remove last_cnx access on invalid packet receive and proper free
This commit is contained in:
parent
ca7e49d601
commit
7ad057e8ea
3 changed files with 7 additions and 1 deletions
|
|
@ -211,11 +211,13 @@ slipstream_server_stream_ctx_t* slipstream_server_create_stream_ctx(slipstream_s
|
|||
int sock_fd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock_fd < 0) {
|
||||
perror("socket() failed");
|
||||
free(stream_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (connect(sock_fd, (struct sockaddr*)&server_ctx->upstream_addr, sizeof(server_ctx->upstream_addr)) < 0) {
|
||||
perror("connect() failed");
|
||||
free(stream_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "../include/slipstream_server_cc.h"
|
||||
#include "slipstream_server_cc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,10 @@ int slipstream_packet_loop_(picoquic_network_thread_ctx_t* thread_ctx, picoquic_
|
|||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
if (last_cnx == NULL) {
|
||||
DBG_PRINTF("last_cnx null in recv", NULL);
|
||||
continue;
|
||||
}
|
||||
slot->cnx = last_cnx;
|
||||
slot->path_id = last_path_id;
|
||||
nb_packet_received++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue