fix use-after-free issue found by Coverity static analysis (thanks to Jiri Popelka)
authorBart De Schuymer <bdschuym@pandora.be>
Thu, 23 Jun 2011 18:25:36 +0000 (18:25 +0000)
committerBart De Schuymer <bdschuym@pandora.be>
Thu, 23 Jun 2011 18:25:36 +0000 (18:25 +0000)
libebtc.c

index 4a9a79d..f66ebef 100644 (file)
--- a/libebtc.c
+++ b/libebtc.c
@@ -473,8 +473,8 @@ void ebt_delete_cc(struct ebt_cntchanges *cc)
                cc->prev->next = cc->next;
                cc->next->prev = cc->prev;
                free(cc);
-       }
-       cc->type = CNT_DEL;
+       } else
+               cc->type = CNT_DEL;
 }
 
 void ebt_empty_chain(struct ebt_u_entries *entries)