Prevent NULL pointer dereference when rtype was incorrect
authorMarius Zbihlei <marius.zbihlei@1and1.ro>
Fri, 14 Jan 2011 15:20:40 +0000 (17:20 +0200)
committerMarius Zbihlei <marius.zbihlei@1and1.ro>
Fri, 14 Jan 2011 15:20:40 +0000 (17:20 +0200)
Found with clang

route.c

diff --git a/route.c b/route.c
index 46725ae..7a29ded 100644 (file)
--- a/route.c
+++ b/route.c
@@ -1754,7 +1754,7 @@ inline static int comp_ip(int op, struct ip_addr* ip, int rtype,
                default:
                        LOG(L_CRIT, "BUG: comp_ip: invalid type for "
                                                " src_ip or dst_ip (%d)\n", rtype);
-                       ret=-1;
+                       return -1;
        }
        /* here "right" is set to the str we compare with */
        r_expop.str=*right;