From 5840c7193c17db20f5ac8dcccb41c140601bf5ff Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 3 Oct 2012 14:12:07 +0000 Subject: [PATCH] fixed a memory leak bug in prohibiting the directory listing --- qse/samples/net/httpd02.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qse/samples/net/httpd02.c b/qse/samples/net/httpd02.c index c1546f84..124a0811 100644 --- a/qse/samples/net/httpd02.c +++ b/qse/samples/net/httpd02.c @@ -84,16 +84,18 @@ static int makersrc ( } else { -#if 0 - if (dflcbstd->makersrc (httpd, client, req, rsrc) <= -1) return -1; + #if 0 + if (server_xtn->orgcbstd->makersrc (httpd, client, req, rsrc) <= -1) return -1; if (rsrc->type == QSE_HTTPD_RSRC_DIR) { /* no directory listing - */ + if (server_xtn->orgcbstd->freersrc) + server_xtn->orgcbstd->freersrc (httpd, client, req, rsrc); rsrc->type = QSE_HTTPD_RSRC_ERROR; - rsrc->u.error.code = 500; + rsrc->u.error.code = 403; } return 0; -#endif + #endif return server_xtn->orgcbstd->makersrc (httpd, client, req, rsrc); } }