Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at tcap-persistentdata.c:1812

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

tcapsrt_close

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/tcap-persistentdata.c)expand/collapse
Show more  
 1778  tcapsrt_close(struct tcaphash_context_t *p_tcaphash_context,
 1779                packet_info *pinfo)
 1780  {
 1781  #ifdef DEBUG_TCAPSRT 
 1782    dbg(60,"Force close ");
 1783  #endif
 1784    if (p_tcaphash_context) {
 1785      p_tcaphash_context->responded=TRUE;
 1786      p_tcaphash_context->last_frame = pinfo->fd->num;
 1787      p_tcaphash_context->end_time = pinfo->fd->abs_ts;
 1788      p_tcaphash_context->closed=TRUE;
 1789   
 1790      /* If the endkey is present */
 1791      if (p_tcaphash_context->endcall
 1792          && !gtcap_PersistentSRT) {
 1793        if (p_tcaphash_context->endcall->next_endcall) {
 1794          if (p_tcaphash_context->endcall->previous_endcall ) {
 1795  #ifdef DEBUG_TCAPSRT 
 1796            dbg(20,"deplace Ehash ");
 1797  #endif
 1798            p_tcaphash_context->endcall->previous_endcall->next_endcall
 1799              = p_tcaphash_context->endcall->next_endcall;
 1800            p_tcaphash_context->endcall->next_endcall->previous_endcall
 1801              = p_tcaphash_context->endcall->previous_endcall;
 1802            g_hash_table_remove(tcaphash_end, p_tcaphash_context->endcall->endkey);
 1803  #ifdef MEM_TCAPSRT 
 1804            g_free(p_tcaphash_context->endcall);
 1805  #endif
 1806          } else {
 1807            /* cannot remove the father */
 1808  #ifdef DEBUG_TCAPSRT 
 1809            dbg(20,"father Ehash ");
 1810  #endif
 1811          } /* no previous link, so father */
 1812        } else if (!gtcap_PersistentSRT) {
 1813  #ifdef DEBUG_TCAPSRT 
 1814          dbg(20,"remove Ehash ");
 1815  #endif
 1816          g_hash_table_remove(tcaphash_end, p_tcaphash_context->endcall->endkey);
 1817  #ifdef MEM_TCAPSRT 
 1818          g_free(p_tcaphash_context->endcall->endkey);
 1819          g_free(p_tcaphash_context->endcall);
 1820  #endif
 1821   
 1822        } /* endcall without chained string */
 1823      } /* no endcall */
 1824   
 1825   
 1826      /* If the contkey is present */
 1827      if (p_tcaphash_context->contcall
 1828          && !gtcap_PersistentSRT) {
 1829        if (p_tcaphash_context->contcall->next_contcall) {
 1830          if (p_tcaphash_context->contcall->previous_contcall ) {
 1831  #ifdef DEBUG_TCAPSRT 
 1832            dbg(20,"deplace Chash ");
 1833  #endif
 1834            p_tcaphash_context->contcall->previous_contcall->next_contcall
 1835              = p_tcaphash_context->contcall->next_contcall;
 1836            p_tcaphash_context->contcall->next_contcall->previous_contcall
 1837              = p_tcaphash_context->contcall->previous_contcall;
 1838            g_hash_table_remove(tcaphash_cont, p_tcaphash_context->contcall->contkey);
 1839  #ifdef MEM_TCAPSRT 
 1840            g_free(p_tcaphash_context->contcall);
 1841  #endif
 1842          } else {
 1843            /* cannot remove the father */
 1844  #ifdef DEBUG_TCAPSRT 
 1845            dbg(20,"father Chash ");
 1846  #endif
 1847          } /* no previous link, so father */
 1848        } else if (!gtcap_PersistentSRT) {
 1849  #ifdef DEBUG_TCAPSRT 
 1850          dbg(20,"remove Chash ");
 1851  #endif
 1852          g_hash_table_remove(tcaphash_cont, p_tcaphash_context->contcall->contkey);
 1853  #ifdef MEM_TCAPSRT 
 1854          g_free(p_tcaphash_context->contcall->contkey);
 1855          g_free(p_tcaphash_context->contcall);
 1856  #endif
 1857        } /* contcall without chained string */
 1858      } /* no contcall */
 1859   
 1860   
 1861      /* If the beginkey is present */
 1862      if (p_tcaphash_context->begincall
 1863          && !gtcap_PersistentSRT) {
 1864        if (p_tcaphash_context->begincall->next_begincall) {
 1865          if (p_tcaphash_context->begincall->previous_begincall ) {
 1866  #ifdef DEBUG_TCAPSRT 
 1867            dbg(20,"deplace Bhash ");
 1868  #endif
 1869            p_tcaphash_context->begincall->previous_begincall->next_begincall
 1870              = p_tcaphash_context->begincall->next_begincall;
 1871            p_tcaphash_context->begincall->next_begincall->previous_begincall
 1872              = p_tcaphash_context->begincall->previous_begincall;
 1873            g_hash_table_remove(tcaphash_begin, p_tcaphash_context->begincall->beginkey);
 1874  #ifdef MEM_TCAPSRT 
 1875            g_free(p_tcaphash_context->begincall);
 1876  #endif
 1877          } else {
 1878            /* cannot remove the father */
 1879  #ifdef DEBUG_TCAPSRT 
 1880            dbg(20,"father Bhash ");
 1881  #endif
 1882          }
 1883        } else  if (!gtcap_PersistentSRT) {
 1884  #ifdef DEBUG_TCAPSRT 
 1885          dbg(20,"remove Bhash ");
 1886  #endif
 1887          g_hash_table_remove(tcaphash_begin, p_tcaphash_context->begincall->beginkey);
 1888  #ifdef MEM_TCAPSRT 
 1889          g_free(p_tcaphash_context->begincall->beginkey);
 1890          g_free(p_tcaphash_context->begincall);
 1891  #endif
 1892        } /* begincall without chained string */
 1893      } /* no begincall */
 1894   
 1895      /* If the ansikey is present */
 1896      if (p_tcaphash_context->ansicall
 1897          && !gtcap_PersistentSRT) {
 1898        if (p_tcaphash_context->ansicall->next_ansicall) {
 1899          if (p_tcaphash_context->ansicall->previous_ansicall ) {
 1900  #ifdef DEBUG_TCAPSRT 
 1901            dbg(20,"deplace Ahash ");
 1902  #endif
 1903            p_tcaphash_context->ansicall->previous_ansicall->next_ansicall
 1904              = p_tcaphash_context->ansicall->next_ansicall;
 1905            p_tcaphash_context->ansicall->next_ansicall->previous_ansicall
 1906              = p_tcaphash_context->ansicall->previous_ansicall;
 1907            g_hash_table_remove(tcaphash_ansi, p_tcaphash_context->ansicall->ansikey);
 1908  #ifdef MEM_TCAPSRT 
 1909            g_free(p_tcaphash_context->ansicall);
 1910  #endif
 1911          } else {
 1912            /* cannot remove the father */
 1913  #ifdef DEBUG_TCAPSRT 
 1914            dbg(20,"father Ahash ");
 1915  #endif
 1916          }
 1917        } else  if (!gtcap_PersistentSRT) {
 1918  #ifdef DEBUG_TCAPSRT 
 1919          dbg(20,"remove Ahash ");
 1920  #endif
 1921          g_hash_table_remove(tcaphash_ansi, p_tcaphash_context->ansicall->ansikey);
 1922  #ifdef MEM_TCAPSRT 
 1923          g_free(p_tcaphash_context->ansicall->ansikey);
 1924          g_free(p_tcaphash_context->ansicall);
 1925  #endif
 1926        } /* ansicall without chained string */
 1927      } /* no ansicall */
 1928   
 1929      if (!gtcap_PersistentSRT) {
 1930  #ifdef DEBUG_TCAPSRT 
 1931        dbg(20,"remove context ");
 1932  #endif
 1933        g_hash_table_remove(tcaphash_context, p_tcaphash_context->key);
 1934  #ifdef MEM_TCAPSRT 
 1935        g_free(p_tcaphash_context->key);
 1936        g_free(p_tcaphash_context);
 1937  #endif
 1938      }
 1939    } else { /* no context */
 1940  #ifdef DEBUG_TCAPSRT 
 1941      dbg(20,"No context to remove ");
 1942  #endif
 1943    }
 1944  }
Show more  




Change Warning 1235.29443 : Redundant Condition

Because they are very similar, this warning shares annotations with warning 1235.29444.

Priority:
State:
Finding:
Owner:
Note: