diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2012-11-27 01:10:30 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2012-12-12 15:38:08 +0100 |
commit | e8aca32f312cbef1cb0b0dd9e87b7e59dc9fa251 (patch) | |
tree | f1dd65169e4cbc6bb7da2d76466b049703587123 /isisd/isis_lsp.c | |
parent | 318c8040abc1b8a737c941382e8aca82e546da09 (diff) |
isisd: address Coverity warnings
this fixes a bunch of issues found by Coverity SCAN and flagged as
"high" impact -- although, they're all rather minute issues.
* isisd/isis_adjacency.c: one superfluous check, one possible NULL deref
* isisd/isis_circuit.c: two prefix memory leaks
* isisd/isis_csm.c: one missing break
* isisd/isis_lsp.c: one possible NULL deref
* isisd/isis_pfpacket.c: one error-case fd leak
* isisd/isis_route.c: one isis_route_info memory leak
* isisd/isis_routemap.c: one... fnord
* isisd/isis_tlv.c: one infinite loop
Reported-by: Coverity SCAN
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_lsp.c')
-rw-r--r-- | isisd/isis_lsp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 082e9dcd..f2a7923d 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -1631,7 +1631,7 @@ lsp_generate (struct isis_area *area, int level) static int lsp_regenerate (struct isis_area *area, int level) { - dict_t *lspdb = area->lspdb[level - 1]; + dict_t *lspdb; struct isis_lsp *lsp, *frag; struct listnode *node; u_char lspid[ISIS_SYS_ID_LEN + 2]; @@ -1640,6 +1640,8 @@ lsp_regenerate (struct isis_area *area, int level) if ((area == NULL) || (area->is_type & level) != level) return ISIS_ERROR; + lspdb = area->lspdb[level - 1]; + memset (lspid, 0, ISIS_SYS_ID_LEN + 2); memcpy (lspid, isis->sysid, ISIS_SYS_ID_LEN); |