]> Git Repo - VerusCoin.git/commitdiff
Test
authorjl777 <[email protected]>
Sun, 5 Nov 2017 13:22:53 +0000 (15:22 +0200)
committerjl777 <[email protected]>
Sun, 5 Nov 2017 13:22:53 +0000 (15:22 +0200)
src/komodo_gateway.h

index 53e31317ff1305ffb63fc0060b67f481fd024aec..4f5abb2fc6bae2bcae76b7a0ae86d91bf3c0906c 100644 (file)
@@ -1377,10 +1377,10 @@ void *OS_loadfile(char *fname,uint8_t **bufp,long *lenp,long *allocsizep)
             printf("OS_loadfile null size.(%s)\n",fname);
             return(0);
         }
-        if ( filesize > buflen-1 )
+        if ( filesize > buflen )
         {
             *allocsizep = filesize;
-            *bufp = buf = (uint8_t *)realloc(buf,(long)*allocsizep);
+            *bufp = buf = (uint8_t *)realloc(buf,(long)*allocsizep+64);
         }
         rewind(fp);
         if ( buf == 0 )
@@ -1441,8 +1441,8 @@ long komodo_stateind_validate(struct komodo_state *sp,char *indfname,uint8_t *fi
             *prevpos100p = prevpos100;
             if ( sp != 0 )
                 komodo_stateind_set(sp,(uint32_t *)inds,n,filedata,fpos,symbol,dest);
-            else free(inds);
             printf("free inds.%p %s validated[%d] fpos.%ld datalen.%ld, offset %ld vs fsize.%ld\n",inds,indfname,i,fpos,datalen,i * sizeof(uint32_t),fsize);
+            free(inds);
             return(fpos);
         } else printf("wrong filesize %s %ld\n",indfname,fsize);
     }
This page took 0.0301670000000001 seconds and 4 git commands to generate.