Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at squat-trie.c:392

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

node_add_child

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts-squat/squat-trie.c)expand/collapse
Show more  
 367  node_add_child(struct squat_trie *trie, struct squat_node *node,
 368                 unsigned char chr, int level)
 369  {
 370          unsigned int old_child_count = node->child_count;
 371          struct squat_node *children, *old_children;
 372          unsigned char *chars;
 373          size_t old_size, new_size;
 374   
 375          i_assert(node->leaf_string_length == 0);
 376   
 377          if (node->want_sequential) {
 378                  node_make_squential(trie, node, level);
 379   
 380                  if (chr < SEQUENTIAL_COUNT)
 381                          return chr;
 382                  old_child_count = SEQUENTIAL_COUNT;
 383          }
 384   
 385          node->child_count++;
 386          new_size = NODE_CHILDREN_ALLOC_SIZE(node->child_count);
 387   
 388          if (old_child_count == 0) {
 389                  /* first child */
 390                  node->children.data = i_malloc(new_size);
 391                  trie->node_alloc_size += new_size;
 392                  children = NODE_CHILDREN_NODES(node);
 393          } else {
 394                  old_size = NODE_CHILDREN_ALLOC_SIZE(old_child_count);
 395                  if (old_size != new_size) {
 396                          trie->node_alloc_size += new_size - old_size;
 397                          node->children.data = i_realloc(node->children.data,
 398                                                          old_size, new_size);
 399                  }
 400   
 401                  children = NODE_CHILDREN_NODES(node);
 402                  old_children = (void *)(NODE_CHILDREN_CHARS(node) +
 403                                          MEM_ALIGN(old_child_count));
 404                  if (children != old_children) {
 405                          memmove(children, old_children,
 406                                  old_child_count * sizeof(struct squat_node));
 407                  }
 408          }
 409   
 410          chars = NODE_CHILDREN_CHARS(node);
 411          chars[node->child_count - 1] = chr;
 412          return node->child_count - 1;
 413  }
Show more  




Change Warning 8082.24494 : Unused Value

Priority:
State:
Finding:
Owner:
Note: