From d126d0be9d96e21c629174c4738c9491ee22341d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 5 Mar 2016 12:22:54 -0300 Subject: [PATCH] freed warning fixed --- iguana/iguana_ramchain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index d5d6d5323..ffc14de6c 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1641,8 +1641,9 @@ uint8_t *iguana_scriptfpget(struct iguana_info *coin,int32_t *scriptlenp,uint8_t if ( (fp= fopen(coin->scriptsfname[spendflag],"rb")) != 0 ) { fseek(fp,scriptoffset,SEEK_SET); - fread(&sdata,1,sizeof(sdata),fp); - if ( sdata.scriptlen > 0 && sdata.scriptlen <= IGUANA_MAXSCRIPTSIZE ) + if ( fread(&sdata,1,sizeof(sdata),fp) != sizeof(sdata) ) + printf("iguana_scriptfpget: error reading sdata\n"); + else if ( sdata.scriptlen > 0 && sdata.scriptlen <= IGUANA_MAXSCRIPTSIZE ) { if ( fread(_script,1,sdata.scriptlen,fp) == sdata.scriptlen ) {