Text   |  XML   |  ReML   |   Visible Warnings:

Free Null Pointer  at squat-trie.c:125

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

squat_trie_map

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts-squat/squat-trie.c)expand/collapse
Show more  
 1480  static int squat_trie_map(struct squat_trie *trie, bool building)
 1481  {
 1482          struct file_lock *file_lock = NULL;
 1483          struct dotlock *dotlock = NULL;
 1484          bool changed;
 1485          int ret;
 1486   
 1487          if (trie->fd != -1) {
 1488                  if (squat_trie_lock(trie, F_RDLCK, &file_lock, &dotlock) <= 0)
 1489                          return -1;
 1490                  if ((trie->flags & SQUAT_INDEX_FLAG_MMAP_DISABLE) != 0 &&
 1491                      trie->file_cache == NULL)
 1492                          trie->file_cache = file_cache_new(trie->fd);
 1493          }
 1494   
 1495[+]         ret = squat_trie_map_header(trie);
 1496          if (ret == 0) {
 1497                  if (file_lock != NULL)
 1498                          file_unlock(&file_lock);
 1499                  else 
 1500                          file_dotlock_delete(&dotlock);
 1501                  squat_trie_delete(trie);
 1502                  squat_trie_close(trie);
 1503                  squat_trie_header_init(trie);
 1504          }
 1505          changed = trie->root.children.offset != trie->hdr.root_offset;
 1506   
 1507          if (changed || trie->hdr.root_offset == 0) {
 1508[+]                 node_free(trie, &trie->root);
expand/collapse

node_free

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts-squat/squat-trie.c)expand/collapse
Show more  
 109  static void node_free(struct squat_trie *trie, struct squat_node *node)
 110  {
 111          struct squat_node *children;
 112          unsigned int i;
 113   
 114          if (node->leaf_string_length > 0) {
 115                  if (NODE_IS_DYNAMIC_LEAF(node))
 116                          i_free(node->children.leaf_string);
 117          } else if (!node->children_not_mapped) {
 118                  children = NODE_CHILDREN_NODES(node);
 119   
 120                  trie->node_alloc_size -=
 121                          NODE_CHILDREN_ALLOC_SIZE(node->child_count);
 122                  for (i = 0; i < node->child_count; i++)
 123                          node_free(trie, &children[i]);
 124   
 125                  i_free(node->children.data);
Show more  
Show more  




Change Warning 11514.25486 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: