The following reply was made to PR mod_auth-any/3226; it has been noted by
GNATS.
From: Marc Slemko <[EMAIL PROTECTED]>
To: Sebastian Andersson <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: mod_auth-any/3226: Memory leak or usage of freed memory.
Date: Fri, 16 Oct 1998 10:50:12 -0700 (PDT)
On 16 Oct 1998, Sebastian Andersson wrote:
> >Description:
> I don't have a full understanding of the Apache API yet so I don't know if
> this is a free memory read or a memory leak problem:
> In src/main/http_config.c:ap_set_file_slot (which is called from mod_auth*)
> the
> arg parameter is in one case just copied to a structure and in another case a
> new string is allocated and copied to the structure without freeing the arg
> string. I believe the correct code should be (the changed line marked with a
> +):
Can you clarify what you mean by "in one case"?
>
> API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, char
> *struct_ptr, char *arg)
> {
> /* Prepend server_root to relative arg.
> This allows .htaccess to be independent of server_root,
> so the server can be moved or mirrored with less pain. */
> char *p;
> int offset = (int) (long) cmd->info;
> if (ap_os_is_path_absolute(arg))
> + p = ap_pstrdup(cmd->pool, arg);
The string will already be allocated from the cmd->pool, so simply duping
it with that pool won't change anything if there was a use of freed
memory.
It shouldn't be a leak since it is still allocated from the proper pool in
the proper scope.