FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fixed a problem that causes a memory leak. We are passing user, pass, · baigk/libhttpserver@e53d066 · GitHub

Commit e53d066

Browse files
committed
fixed a problem that causes a memory leak. We are passing user, pass,
and digested_user as char pointers by value which causes the original pointers be always null when they are going to be free in complete_request, now we pass them by reference and everything works fine
1 parent 4cbfc1f commit e53d066

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/httpserver/webserver.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class webserver
328328

329329
void end_request_construction(MHD_Connection* connection,
330330
struct details::modded_request* mr, const char* version,
331-
const char* method, char* user, char* pass, char* digested_user
331+
const char* method, char* &user, char* &pass, char* &digested_user
332332
);
333333

334334
int finalize_answer(MHD_Connection* connection,

‎src/webserver.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@ void webserver::end_request_construction(
964964
struct details::modded_request* mr,
965965
const char* version,
966966
const char* method,
967-
char* user,
968-
char* pass,
969-
char* digested_user
967+
char* &user,
968+
char* &pass,
969+
char* &digested_user
970970
)
971971
{
972972
mr->ws = this;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL