Changeset 383 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Dec 5, 2011, 10:30:33 PM (13 years ago)
Author:
katerina
Message:

Fix for ticket #281 (warnings from clang static analyzer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r371 r383  
    600600                prev->next = p->next;
    601601
    602               p = delete_db_entry(p);
     602              delete_db_entry(p);
    603603
    604604              SL_RET0(_("hash_unvisited"));
     
    693693            entries.prev->next = p->next;
    694694         
    695           p = delete_db_entry(p);
     695          delete_db_entry(p);
    696696         
    697697          goto end;
     
    915915              SL_RET0(_("hashinsert"));
    916916            }
    917           else
    918             if (p->next == NULL)
    919               {
    920                 p->next = s;
    921                 p->next->next = NULL;
    922                 SL_RET0(_("hashinsert"));
    923               }
    924           p = p->next;
     917          else if (p && p->next == NULL)
     918            {
     919              p->next = s;
     920              p->next->next = NULL;
     921              SL_RET0(_("hashinsert"));
     922            }
     923          if (p)
     924            p = p->next;
     925          else /* cannot really happen, but llvm/clang does not know */
     926            break;
    925927        }
    926928    }
     
    14701472  sl_close (fd);
    14711473  sh_hash_getline_end();
    1472   fd = -1;
     1474  /* fd = -1; */
    14731475
    14741476 unlock_and_return:
Note: See TracChangeset for help on using the changeset viewer.