Changeset 510


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

Fix leaks in ZOO-Kernel.

Location:
trunk/zoo-project/zoo-kernel
Files:
3 edited

Legend:

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

    r509 r510  
    32253225          fcontent[hInternet->ihandle[index].nDataLen]=0;
    32263226          fsize=hInternet->ihandle[index].nDataLen;
    3227           mimeType=strdup((char*)hInternet->ihandle[index].mimeType);
     3227          if(hInternet->ihandle[index].mimeType==NULL)
     3228            mimeType=strdup("none");
     3229          else
     3230            mimeType=strdup((char*)hInternet->ihandle[index].mimeType);
    32283231         
    32293232          map* tmpMap=getMapOrFill(&content->content,"value","");
  • 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;
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r507 r510  
    19811981    tmps=tmpsptr->nodesetval;
    19821982    if(tmps->nodeNr==0){
     1983      xmlXPathFreeObject(tmpsptr);
    19831984      tmpsptr=extractFromDoc(doc,"/*/*/*[local-name()='RawDataOutput']");
    19841985      tmps=tmpsptr->nodesetval;
     
    20312032            free(tmpmaps->name);
    20322033            tmpmaps->name=zStrdup((char*)val);
     2034            xmlFree(val);
    20332035          }
    20342036          cur2=cur2->next;
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