From ab718c464d7365d83168368398f612a543a5f74d Mon Sep 17 00:00:00 2001 From: Andrew McNab Date: Mon, 5 Jun 2006 12:29:59 +0000 Subject: [PATCH] Sync --- org.gridsite.core/src/gridsite.spec | 1 + org.gridsite.core/src/mod_gridsite.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/org.gridsite.core/src/gridsite.spec b/org.gridsite.core/src/gridsite.spec index 993da72..6a87236 100644 --- a/org.gridsite.core/src/gridsite.spec +++ b/org.gridsite.core/src/gridsite.spec @@ -158,6 +158,7 @@ fi %package slashgrid Group: Applications/Internet Summary: slashgrid daemon +Requires: curl,fuse,fuse-libs %description slashgrid SlashGrid daemon diff --git a/org.gridsite.core/src/mod_gridsite.c b/org.gridsite.core/src/mod_gridsite.c index 36efc51..1321eec 100644 --- a/org.gridsite.core/src/mod_gridsite.c +++ b/org.gridsite.core/src/mod_gridsite.c @@ -404,7 +404,8 @@ int html_format(request_rec *r, mod_gridsite_dir_cfg *conf) /* first make a buffer big enough to hold path names we want to try */ fd = -1; - s = malloc(strlen(r->filename) + strlen(conf->headfile) + 1); + s = apr_palloc(r->pool, + strlen(r->filename) + strlen(conf->headfile) + 1); strcpy(s, r->filename); for (;;) @@ -420,8 +421,6 @@ int html_format(request_rec *r, mod_gridsite_dir_cfg *conf) *p = '\0'; } - free(s); - if (fd == -1) /* not found, so set up not to output one */ { head_formatted = apr_pstrdup(r->pool, ""); @@ -482,7 +481,8 @@ int html_format(request_rec *r, mod_gridsite_dir_cfg *conf) /* first make a buffer big enough to hold path names we want to try */ fd = -1; - s = malloc(strlen(r->filename) + strlen(conf->footfile)); + s = apr_palloc(r->pool, + strlen(r->filename) + strlen(conf->footfile) + 1); strcpy(s, r->filename); for (;;) @@ -499,8 +499,6 @@ int html_format(request_rec *r, mod_gridsite_dir_cfg *conf) *p = '\0'; } - free(s); - if (fd == -1) /* failed to find a footer, so set up empty default */ { footer_formatted = apr_pstrdup(r->pool, ""); @@ -550,7 +548,6 @@ int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf) struct dirent **namelist; if (r->finfo.filetype == APR_NOFILE) return HTTP_NOT_FOUND; - /* Put in Delegation service header if required */ if (conf->delegationuri) delegation_header(r, conf); @@ -564,7 +561,8 @@ int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf) /* first make a buffer big enough to hold path names we want to try */ fd = -1; - s = malloc(strlen(r->filename) + strlen(conf->headfile) + 1); + s = apr_palloc(r->pool, + strlen(r->filename) + strlen(conf->headfile) + 1); strcpy(s, r->filename); for (;;) @@ -580,8 +578,6 @@ int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf) *p = '\0'; } - free(s); - if (fd == -1) /* not found, so set up to output sensible default */ { header_formatted = apr_pstrdup(r->pool, ""); @@ -679,7 +675,8 @@ int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf) /* first make a buffer big enough to hold path names we want to try */ fd = -1; - s = malloc(strlen(r->filename) + strlen(conf->footfile)); + s = apr_palloc(r->pool, + strlen(r->filename) + strlen(conf->footfile) + 1); strcpy(s, r->filename); for (;;) @@ -696,8 +693,6 @@ int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf) *p = '\0'; } - free(s); - if (fd == -1) /* failed to find a footer, so use standard default */ { footer_formatted = apr_pstrdup(r->pool, ""); -- 1.8.2.3