Ignore:
Timestamp:
Oct 16, 2014, 10:02:46 AM (8 years ago)
Author:
djay
Message:

Fix leaks in ZOO-Kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/zoo_loader.c

    r490 r510  
    9797       while((r=fread(buffer,sizeof(char),1,cgiIn))){
    9898         buffer[1]=0;
    99          cgiContentLength+=r;
    10099         if(res==NULL){
    101100           res=(char*)malloc(2*sizeof(char));
     
    103102         }
    104103         else{
    105            char *tmp=zStrdup(res);
    106            res=(char*)realloc(res,(strlen(tmp)+2)*sizeof(char));
    107            sprintf(res,"%s%s",tmp,buffer);
    108            free(tmp);
     104           res=(char*)realloc(res,(cgiContentLength+2)*sizeof(char));
     105           memcpy(res + cgiContentLength, buffer, sizeof(char));
     106           res[cgiContentLength+1]=0;
    109107         }
     108         cgiContentLength+=r;
    110109       }
    111110       delete[] buffer;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png