X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=src%2Fcallscgi.c;h=e91759e46c32b04ac92e28b9a05f8fcb85f3dec7;hp=84b63c551b72af9843a16064241ae540f06d6f99;hb=e25bf4f9646b5ee2cfe363fca67a32d4e2a3f0cc;hpb=195c98fad0b9a48e87cdbc1b4ea32d4338c2c52a diff --git a/src/callscgi.c b/src/callscgi.c index 84b63c5..e91759e 100644 --- a/src/callscgi.c +++ b/src/callscgi.c @@ -428,6 +428,7 @@ static void mkcgienv(struct hthead *req, struct charbuf *dst) } else { bufaddenv(dst, "SCRIPT_NAME", "%s", url); } + free(url); bufaddenv(dst, "QUERY_STRING", "%s", qp?qp:""); if((h = getheader(req, "Host")) != NULL) bufaddenv(dst, "SERVER_NAME", "%s", h); @@ -445,8 +446,11 @@ static void mkcgienv(struct hthead *req, struct charbuf *dst) bufaddenv(dst, "CONTENT_LENGTH", "%s", h); else bufaddenv(dst, "CONTENT_LENGTH", "0"); - if((h = getheader(req, "X-Ash-File")) != NULL) - bufaddenv(dst, "SCRIPT_FILENAME", "%s", absolutify(h)); + if((h = getheader(req, "X-Ash-File")) != NULL) { + h = absolutify(h); + bufaddenv(dst, "SCRIPT_FILENAME", "%s", h); + free(h); + } for(i = 0; i < req->noheaders; i++) { h = sprintf2("HTTP_%s", req->headers[i][0]); for(p = h; *p; p++) {