Changeset - 393ab8fcf2ee
[Not reviewed]
default
0 2 0
Ethan Zonca (ethanzonca) - 15 years ago 2010-09-13 23:00:23
e@ethanzonca.com
Fixed doublefree
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/simpleslave.c
Show inline comments
 
@@ -303,42 +303,43 @@ if(updateConf){
 
            fprintf(stderr, "Finished frame %d in job %d, uploading...\n", framenum, jobnum);
 
          else
 
            fprintf(stderr,"Finished.\n");
 
          uploadOutput(pathtoOutput, urltoOutput, jobnum, framenum, slavekey); // @TODO: Handle return value
 

	
 
          free(urltoOutput);
 
          free(pathtoOutput);
 
          urltoOutput = NULL;
 
          pathtoOutput = NULL;
 
          // Tell the server that rendering and upload are complete
 
          _web_finishframe(slavekey, password, jobnum, framenum);
 
        }
 

	
 
        free(outputExt);
 
      }
 
    else{
 
      if(DEBUG)
 
        fprintf(stderr,"No work to do. Idling...\n");
 
      else
 
        fprintf(stderr,".");
 
      sleep(60); // Poll every 300 seconds @TODO: remove polling
 
    }
 

	
 
    // @TODO: If the server says that every frame for the last jobnum is finished, OR if the data is getting old
 
    if(1 == 0)
 
      {
 
        // Note: individual frames are already deleted after uploading,
 
        // except for ones that couldn't be uploaded
 
        delete_jobdata(jobnum, datadir);
 
      }
 

	
 
    free(outputExt);
 
  }
 

	
 
  free(my_cfg);
 
  free(datadir);
 
  free(urltoTar);
 
  free(pathtoTar);
 
  free(pathtoTardir);
 
  free(pathtoJob);
 
  free(pathtoJobfile);
 
  free(urltoJobfile);
 
  free(urltoOutput);
 
  free(pathtoRenderOutput);
src/server/slavefuncs.c
Show inline comments
 
@@ -37,25 +37,25 @@
 
#include <ctype.h>
 
#include <errno.h>
 
#include <stdio.h>
 
#include <string.h>
 
#include <unistd.h>
 
#include <stdlib.h>
 
#include <sys/stat.h>
 
#include <fcntl.h>
 

	
 
#include <time.h>
 

	
 
// Function debug
 
#define DEBUG 1
 
#define DEBUG 0
 

	
 
/*
 
void stringToUpper(char *string){
 
  while(*string != '\0') {
 
    *string = toupper((unsigned char)*string);
 
  }
 
}
 
*/
 

	
 
void stringToUpper(char *buffer){
 
    for(; *buffer; buffer ++)
 
      *buffer = toupper(*buffer);
0 comments (0 inline, 0 general)