+2005-04-17 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * http.c (request_set_header): Free NAME when VALUE is NULL and
+ freeing the header name is requested.
+
2005-04-17 Hrvoje Niksic <hniksic@xemacs.org>
* snprintf.c (fmtstr): Declare VALUE as const char *.
struct request_header *hdr;
int i;
if (!value)
- return;
+ {
+ /* A NULL value is a no-op; if freeing the name is requested,
+ free it now to avoid leaks. */
+ if (release_policy == rel_name || release_policy == rel_both)
+ xfree (name);
+ return;
+ }
for (i = 0; i < req->hcount; i++)
{
hdr = &req->headers[i];