X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfcgi.c;h=fec09e3c4cf16a3600d6f691dab9c84e11797498;hb=8526dcf3a698c688e2cc4430ae106b5ecf70677f;hp=67e0b4c03f89b4d6bc421c28a6be2a3f8f44d029;hpb=e448c7a56df8e289c9dbd5b8d87753addd541091;p=swftools.git diff --git a/lib/modules/swfcgi.c b/lib/modules/swfcgi.c index 67e0b4c..fec09e3 100644 --- a/lib/modules/swfcgi.c +++ b/lib/modules/swfcgi.c @@ -9,9 +9,19 @@ Copyright (c) 2001 Rainer Böhme - This file is distributed under the GPL, see file COPYING for details + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -*/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define ishex(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'a' && (x) <= 'f') || ((x) >= 'A' && (x) <= 'F')) @@ -59,7 +69,7 @@ static void swf_cgienv(unsigned char * var) // fprintf(stderr,"%s\n",var); - buf = (unsigned char*)malloc(strlen(var) + sizeof(PREFIX) + 2); + buf = (unsigned char*)rfx_alloc(strlen(var) + sizeof(PREFIX) + 2); if (!buf) return; strcpy(buf, PREFIX); @@ -97,7 +107,7 @@ static void swf_cgienv(unsigned char * var) } if ((oldval = getenv(buf))) - { newval = (unsigned char*)malloc(strlen(oldval) + strlen(buf) + strlen(&c[1]) + 3); + { newval = (unsigned char*)rfx_alloc(strlen(oldval) + strlen(buf) + strlen(&c[1]) + 3); if (!newval) return; c[0] = '='; @@ -114,8 +124,8 @@ static void swf_cgienv(unsigned char * var) putenv(newval); if (oldval) - { free(oldval); - free(buf); + { rfx_free(oldval); + rfx_free(buf); } } @@ -145,7 +155,7 @@ char * swf_postread() if (!buf) return NULL; size = atoi(buf); - buf = (unsigned char*)malloc(size + 1); + buf = (unsigned char*)rfx_alloc(size + 1); if (buf) { do { got = fread(buf + sofar, 1, size - sofar, stdin); @@ -164,14 +174,14 @@ void swf_uncgi() if ((query) && strlen(query)) { dupquery = strdup(query); swf_scanquery(dupquery); - free(dupquery); + rfx_free(dupquery); } method = getenv("REQUEST_METHOD"); if ((method) && ! strcmp(method, "POST")) { query = swf_postread(); if ((query)&&(query[0]!=0)) swf_scanquery(query); - free(query); + rfx_free(query); } }