Browse code

Prevent NULL pointer dereference when rtype was incorrect

Found with clang

Marius Zbihlei authored on 14/01/2011 15:20:40
Showing 1 changed files
... ...
@@ -1754,7 +1754,7 @@ inline static int comp_ip(int op, struct ip_addr* ip, int rtype,
1754 1754
 		default:
1755 1755
 			LOG(L_CRIT, "BUG: comp_ip: invalid type for "
1756 1756
 						" src_ip or dst_ip (%d)\n", rtype);
1757
-			ret=-1;
1757
+			return -1;
1758 1758
 	}
1759 1759
 	/* here "right" is set to the str we compare with */
1760 1760
 	r_expop.str=*right;