Fix memory leak in big_upload example

PUBLISHED_FROM=e6ccbd73b27985fbf9949adc3e07c90a75f75603
This commit is contained in:
Dmitry Frank 2018-01-30 14:42:05 +02:00 committed by Cesanta Bot
parent 4cf9f99ae9
commit 5d5badfcee

View File

@ -33,6 +33,7 @@ static void handle_upload(struct mg_connection *nc, int ev, void *p) {
"HTTP/1.1 500 Failed to open a file\r\n" "HTTP/1.1 500 Failed to open a file\r\n"
"Content-Length: 0\r\n\r\n"); "Content-Length: 0\r\n\r\n");
nc->flags |= MG_F_SEND_AND_CLOSE; nc->flags |= MG_F_SEND_AND_CLOSE;
free(data);
return; return;
} }
nc->user_data = (void *) data; nc->user_data = (void *) data;