Skip to content

Commit 0b8ee93

Browse files
committed
Fix the leak by freeing url and urlFragment
1 parent d1bc2dc commit 0b8ee93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/http.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ http_callback_404(httpd *webserver, request *r, int error_code)
156156
debug(LOG_INFO, "allow subdomain");
157157
fw_allow_host(r->request.host);
158158
http_send_redirect(r, tmp_url, "allow subdomain");
159+
free(url);
160+
free(urlFragment);
159161
return;
160162
}
161163
} else {
162164
// e.g. "example.com" is in conf, so it had been parse to IP and added into "iptables allow" when wifidog start. but then its' A record(IP) changed, it will go to here.
163165
debug(LOG_INFO, "allow domain again, because IP changed");
164166
fw_allow_host(r->request.host);
165167
http_send_redirect(r, tmp_url, "allow domain");
168+
free(url);
169+
free(urlFragment);
166170
return;
167171
}
168172
}

0 commit comments

Comments
 (0)