pike.git / src / modules / _WhiteFish / whitefish.c

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:70:   static void handle_hit( Blob **blobs,    int nblobs,    struct object *res,    int docid,    double *field_c[65],    double *prox_c[8],    double mc, double mp,    int cutoff )   {    int i, j, k, end = 0; -  Hit *hits = malloc( nblobs * sizeof(Hit) ); +  Hit *hits = calloc( nblobs, sizeof(Hit) );    unsigned char *nhits = malloc( nblobs );    unsigned char *pos = malloc( nblobs );       int matrix[65][8];       MEMSET(matrix, 0, sizeof(matrix) ); -  MEMSET(hits, 0, nblobs * sizeof(Hit) ); -  MEMSET(pos, 0, nblobs ); +        for( i = 0; i<nblobs; i++ )    nhits[i] = wf_blob_nhits( blobs[i] );          for( i = 0; i<nblobs; i++ )    {    MEMSET( pos, 0, nblobs );    for( j = 0; j<nhits[i]; j++ )    {