You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2017/09/26 19:50:46 UTC

svn commit: r1809779 - /subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c

Author: brane
Date: Tue Sep 26 19:50:45 2017
New Revision: 1809779

URL: http://svn.apache.org/viewvc?rev=1809779&view=rev
Log:
On the mod-dav-svn-expressions branch: Use computed object sizes
for allocations in mod_dav_svn. No functional change.

* subversion/mod_dav_svn/mod_dav_svn.c
  (init_dso, SVNPath_cmd, SVNParentPath_cmd): Allocate space based on
   the size of the object, not the size of its type, to avoid implicit
   dependencies between declarations and allocations.

Modified:
    subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c

Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c?rev=1809779&r1=1809778&r2=1809779&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c Tue Sep 26 19:50:45 2017
@@ -215,7 +215,7 @@ init_dso(apr_pool_t *pconf, apr_pool_t *
 static void *
 create_server_config(apr_pool_t *p, server_rec *s)
 {
-  server_conf_t *conf = apr_pcalloc(p, sizeof(server_conf_t));
+  server_conf_t *conf = apr_pcalloc(p, sizeof(*conf));
 
   conf->compression_level = -1;
 
@@ -506,7 +506,7 @@ SVNPath_cmd(cmd_parms *cmd, void *config
   if (conf->fs_parent_path != NULL)
     return "SVNPath cannot be defined at same time as SVNParentPath.";
 
-  conf->fs_path = apr_pcalloc(cmd->pool, sizeof(path_expr_t));
+  conf->fs_path = apr_pcalloc(cmd->pool, sizeof(*conf->fs_path));
   conf->fs_path->base = svn_dirent_internal_style(arg1, cmd->pool);
 
   if (arg2)
@@ -554,7 +554,7 @@ SVNParentPath_cmd(cmd_parms *cmd, void *
   if (conf->fs_path != NULL)
     return "SVNParentPath cannot be defined at same time as SVNPath.";
 
-  conf->fs_parent_path = apr_pcalloc(cmd->pool, sizeof(path_expr_t));
+  conf->fs_parent_path = apr_pcalloc(cmd->pool, sizeof(*conf->fs_parent_path));
   conf->fs_parent_path->base = svn_dirent_internal_style(arg1, cmd->pool);
 
   if (arg2)