Dead code cleanup. Coverity 728047, 728048, 728049.

pull/105/merge
Victor Julien 13 years ago
parent ee5d6fdb6f
commit c3f4f8d46a

@ -596,11 +596,11 @@ static void DetectAddressParseIPv6CIDR(int cidr, struct in6_addr *in6)
*/
int DetectAddressParseString(DetectAddress *dd, char *str)
{
char *ipdup = SCStrdup(str);
char *ip = NULL;
char *ip2 = NULL;
char *mask = NULL;
int r = 0;
char *ipdup = SCStrdup(str);
if (unlikely(ipdup == NULL))
return -1;
@ -618,9 +618,6 @@ int DetectAddressParseString(DetectAddress *dd, char *str)
/* we dup so we can put a nul-termination in it later */
ip = ipdup;
if (ip == NULL) {
goto error;
}
/* handle the negation case */
if (ip[0] == '!') {

@ -102,11 +102,11 @@ static uint8_t IPOnlyCIDRItemCompare(IPOnlyCIDRItem *head,
*/
static int IPOnlyCIDRItemParseSingle(IPOnlyCIDRItem *dd, char *str)
{
char *ipdup = SCStrdup(str);
char *ip = NULL;
char *ip2 = NULL;
char *mask = NULL;
int r = 0;
char *ipdup = SCStrdup(str);
if (unlikely(ipdup == NULL))
return -1;
@ -135,9 +135,6 @@ static int IPOnlyCIDRItemParseSingle(IPOnlyCIDRItem *dd, char *str)
/* we dup so we can put a nul-termination in it later */
ip = ipdup;
if (ip == NULL) {
goto error;
}
/* handle the negation case */
if (ip[0] == '!') {

@ -1379,13 +1379,14 @@ error:
* \retval NULL on error
*/
DetectPort *PortParse(char *str) {
char *portdup = SCStrdup(str);
char *port2 = NULL;
DetectPort *dp = NULL;
char *portdup = SCStrdup(str);
if (unlikely(portdup == NULL)) {
return NULL;
}
dp = DetectPortInit();
if (dp == NULL)
goto error;
@ -1394,9 +1395,6 @@ DetectPort *PortParse(char *str) {
/* we dup so we can put a nul-termination in it later */
char *port = portdup;
if (port == NULL) {
goto error;
}
/* handle the negation case */
if (port[0] == '!') {

Loading…
Cancel
Save