works for niosg

This commit is contained in:
2021-09-14 10:30:04 +02:00
parent b2cb99a0c2
commit 0f8869153e
6 changed files with 55 additions and 10 deletions

View File

@ -3711,14 +3711,14 @@ int program_fpga(int file_des) {
// receive program
if (ret == OK) {
char *fpgasrc = malloc(filesize);
if (receiveData(file_des, fpgasrc, filesize, OTHER) < 0)
if (receiveData(file_des, fpgasrc, filesize, OTHER) < 0) {
free(fpgasrc);
return printSocketReadError();
}
#ifndef VIRTUAL
ret = eraseAndWriteToFlash(mess, checksum, fpgasrc, filesize);
#endif
Server_SendResult(file_des, INT32, NULL, 0);
// free resources
free(fpgasrc);
}
if (ret == FAIL) {