Skip to content

Commit 9f15463

Browse files
author
Sebastiano Merlino
committed
Avoid memory leak
Avoid a memory leak due to a typo (this is embarassing) in response completion.
1 parent 8197d6c commit 9f15463

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/webserver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,12 @@ void webserver::request_completed (
558558
}
559559
pthread_rwlock_unlock(&mr->ws->comet_guard);
560560

561-
if (0x0 == mr)
561+
if (0x0 != mr)
562562
{
563563
if(mr->dhrs.res != 0x0 && mr->dhrs->ca != 0x0)
564564
mr->dhrs->ca(mr->dhrs->closure_data);
565565
delete mr;
566+
mr = 0x0;
566567
}
567568
}
568569

0 commit comments

Comments
 (0)