www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Andersson ...@hogia.net>
Subject mod_auth-any/3226: Memory leak or usage of freed memory.
Date Fri, 16 Oct 1998 07:48:41 GMT

>Number:         3226
>Category:       mod_auth-any
>Synopsis:       Memory leak or usage of freed memory.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Oct 16 00:50:00 PDT 1998
>Last-Modified:
>Originator:     sa@hogia.net
>Organization:
apache
>Release:        1.3.3
>Environment:
All.
>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 +):

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);
    else
        p = ap_make_full_path(cmd->pool, ap_server_root, arg);
    *(char **) (struct_ptr + offset) = p;
    return NULL;
}
>How-To-Repeat:

>Fix:
Yes.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]




Mime
View raw message