*/
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;
/* 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] == '!') {
*/
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;
/* 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] == '!') {
* \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;
/* 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] == '!') {