httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52976] New: Gratuitous string-duplication in module-configuration (apr_pstrdup)
Date Fri, 23 Mar 2012 01:09:12 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52976

             Bug #: 52976
           Summary: Gratuitous string-duplication in module-configuration
                    (apr_pstrdup)
           Product: Apache httpd-2
           Version: 2.2.22
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_ftp
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: mi+apache@aldan.algebra.com
    Classification: Unclassified


Every string passed to the configuration-parsing functions in mod_ftp.c is
duplicated (via apr_pstrdup) for the ftp_server_config-structure, instead of
simply recording a direct reference to it (as const char *).

Such duplication seems redundant. Is there anything wrong with the following
replacement, for example:

-       fsc->homedir = apr_pstrdup(cmd->pool, dir);
+       fsc->homedir = dir;

Does not the configuration-parsing pool live forever?

My own little module here treats such strings the way I propose -- it never has
a crash, and valgrind has no issues with it whatsoever...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message