You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2001/03/15 16:05:39 UTC
cvs commit: httpd-apreq/c apache_request.c
joes 01/03/15 07:05:38
Modified: c apache_request.c
Log:
Fix potiential name leak in ApacheRequest_tmpfile. [joes]
Revision Changes Path
1.10 +3 -3 httpd-apreq/c/apache_request.c
Index: apache_request.c
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- apache_request.c 2001/03/15 03:04:12 1.9
+++ apache_request.c 2001/03/15 15:05:35 1.10
@@ -320,6 +320,7 @@
static void remove_tmpfile(void *data) {
remove((char *) data);
+ free((char *) data);
}
FILE *ApacheRequest_tmpfile(ApacheRequest *req, ApacheUpload *upload)
@@ -342,15 +343,14 @@
if ( tries == 0 || (fp = ap_pfdopen(r->pool, fd, "w+") ) == NULL ) {
ap_log_rerror(REQ_ERROR,
"[libapreq] could not open temp file '%s'", name);
- if ( fd >= 0 ) { remove(name); }
+ if ( fd >= 0 ) { remove(name); free(name); }
return NULL;
}
upload->fp = fp;
- upload->tempname = ap_pstrdup(r->pool, name);
+ upload->tempname = name;
ap_register_cleanup(r->pool, (void *)upload->tempname,
remove_tmpfile, ap_null_cleanup);
-
return fp;
}