From a633338fbedcad32a50f709d567b0356692a068c Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sat, 26 Nov 2011 21:57:05 -0500 Subject: [PATCH] Memory leak fix CID 5769 --- src/apps/poorman/libhttpd/libhttpd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/apps/poorman/libhttpd/libhttpd.c b/src/apps/poorman/libhttpd/libhttpd.c index 1c4523910b..b982d1529d 100644 --- a/src/apps/poorman/libhttpd/libhttpd.c +++ b/src/apps/poorman/libhttpd/libhttpd.c @@ -2703,6 +2703,7 @@ ls( httpd_conn* hc ) poorman_log(logString, true, hc->client_addr.sa_in.sin_addr.s_addr, RED); // syslog( LOG_ERR, "opendir %.80s - %m", hc->expnfilename ); httpd_send_err( hc, 404, err404title, "", err404form, hc->encodedurl ); + free(de); return -1; } @@ -2758,6 +2759,7 @@ ls( httpd_conn* hc ) hc, 500, err500title, "", err500form, hc->encodedurl ); httpd_write_response( hc ); closedir( dirp ); + free(de); return -1; } @@ -2942,10 +2944,11 @@ ls( httpd_conn* hc ) closedir( dirp ); httpd_send_err( hc, 501, err501title, "", err501form, httpd_method_str( hc->method ) ); + free(de); return -1; } - - return 0; + free(de); + return 0; } #endif /* GENERATE_INDEXES */