. Patch up a leak by freeing target when needed.

This commit is contained in:
Emil Mikulic 2003-11-24 11:54:34 +00:00
parent 832851b83d
commit 850543f7d6

View File

@ -1477,6 +1477,7 @@ static void process_get(struct connection *conn)
default_reply(conn, 500, "Internal Server Error",
"stat(%s) failed: %s.", conn->uri, strerror(errno));
safefree(target);
return;
}
@ -1484,11 +1485,13 @@ static void process_get(struct connection *conn)
if (S_ISDIR(filestat.st_mode))
{
redirect(conn, "%s/", conn->uri);
safefree(target);
return;
}
else if (!S_ISREG(filestat.st_mode))
{
default_reply(conn, 403, "Forbidden", "Not a regular file.");
safefree(target);
return;
}