Changeset - 7f610e2808f2
[Not reviewed]
default
0 3 0
Ethan Zonca (ethanzonca) - 15 years ago 2010-03-23 00:23:20
e@ethanzonca.com
Fixed many memory leaks
3 files changed with 25 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/common/options.c
Show inline comments
 
@@ -105,6 +105,8 @@ int options_init(int argc, char *argv[],
 
  if(chdir(configfileprefix))
 
    fprintf(stderr, "Unable to chdir(\"%s\") where I expected to find config files, expect failure\n", configfileprefix);
 

	
 
  free(configfileprefix);
 

	
 
  _distren_asprintf(&configfile, "%s%s.conf", PACKAGE, myname);
 
  if(!configfile)
 
    {
src/server/simpleslave.c
Show inline comments
 
@@ -211,6 +211,7 @@ int main(int argc, char *argv[])
 
            return 1;
 
          }
 
        free(pathtoJobfile);
 
        pathtoJobfile = NULL;
 

	
 
        struct stat buffer;
 
        int fstatus = stat(pathtoOutput, &buffer);
 
@@ -226,7 +227,8 @@ int main(int argc, char *argv[])
 

	
 
          free(urltoOutput);
 
          free(pathtoOutput);
 

	
 
          urltoOutput = NULL;
 
          pathtoOutput = NULL;
 
          // Tell the server that rendering and upload are complete
 
          _web_finishframe(slavekey, password, jobnum, framenum);
 
        }
 
@@ -245,6 +247,18 @@ int main(int argc, char *argv[])
 
      }
 
  }
 

	
 
  free(my_cfg);
 
  free(outputExt);
 
  free(datadir);
 
  free(urltoTar);
 
  free(pathtoTar);
 
  free(pathtoTardir);
 
  free(pathtoJob);
 
  free(pathtoJobfile);
 
  free(urltoJobfile);
 
  free(urltoOutput);
 
  free(pathtoRenderOutput);
 
  free(pathtoOutdir);
 
  fprintf(stderr,"Goodbye!\n");
 
  return 0;
 
}
src/server/slavefuncs.c
Show inline comments
 
@@ -238,6 +238,9 @@ int curlpost(char *filename, char *url, 
 
    /* cleanup the formpost junk */
 
    curl_formfree(formpost);
 
    curl_slist_free_all (headerlist);
 
    free(sjobnum);
 
    free(sframenum);
 
    free(sslavekey);
 
  }
 
  return res;
 
}
 
@@ -323,7 +326,7 @@ int exec_blender(char *input, char *outp
 
       fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 

	
 
  free(frame_str);
 
  return ret;
 
}
 

	
 
@@ -678,9 +681,7 @@ struct _web_memorystruct _web_getrequest
 

	
 
  /* we're done with libcurl, so clean it up */
 
  curl_global_cleanup();
 

	
 
  return chunk; // 0 is OK, 1 is 404 or other error
 

	
 
}
 

	
 
void _web_finishframe(int slavekey, char *slavepass, int jobnum, int framenum){
 
@@ -829,13 +830,13 @@ int slaveBenchmark(char *datadir, int *b
 
  else
 
    remove(output);
 

	
 
  free(frame_str);
 
  free(input);
 
  free(output);
 

	
 
  *benchmarkTime = abs(difftime(startTime,endTime));
 
  float tmp = *benchmarkTime;
 
  tmp = (1/tmp) * 50000;
 
  *renderPower = (int)tmp;
 
  free(realOutput);
 
  free(frame_str);
 
  free(input);
 
  free(output);
 
  return ret;
 
}
0 comments (0 inline, 0 general)