funcs name only in c++, bug fix:slsdetectorusers not deleting multislsdetectorcommand object, bug fix: programfpga does not delete fpgasrc malloc if returning in failure

This commit is contained in:
2018-10-12 17:37:39 +02:00
parent 8df63b7767
commit 178b832223
3 changed files with 10 additions and 2 deletions

View File

@ -5101,12 +5101,16 @@ int slsDetector::programFPGA(std::string fname) {
if(fread(fpgasrc, sizeof(char), filesize, fp) != filesize){
std::cout << "Could not read rawbin file" << std::endl;
setErrorMask((getErrorMask())|(PROGRAMMING_ERROR));
if(fpgasrc != NULL)
free(fpgasrc);
return FAIL;
}
if(fclose(fp)){
std::cout << "Could not close destination file after converting" << std::endl;
setErrorMask((getErrorMask())|(PROGRAMMING_ERROR));
if(fpgasrc != NULL)
free(fpgasrc);
return FAIL;
}
unlink(destfname); // delete temporary file