urilen: fix memory leak when freeing the rule

pull/562/head
Victor Julien 12 years ago
parent cfa2cda42b
commit ec724a1e56

@ -88,8 +88,10 @@ void DetectUrilenRegister(void)
return; return;
error: error:
if (parse_regex != NULL) SCFree(parse_regex); if (parse_regex != NULL)
if (parse_regex_study != NULL) SCFree(parse_regex_study); pcre_free(parse_regex);
if (parse_regex_study != NULL)
pcre_free_study(parse_regex_study);
return; return;
} }
@ -172,7 +174,7 @@ DetectUrilenData *DetectUrilenParse (char *urilenstr)
urilend = SCMalloc(sizeof (DetectUrilenData)); urilend = SCMalloc(sizeof (DetectUrilenData));
if (unlikely(urilend == NULL)) if (unlikely(urilend == NULL))
goto error; goto error;
memset(urilend, 0, sizeof(DetectUrilenData)); memset(urilend, 0, sizeof(DetectUrilenData));
if (arg1[0] == '<') if (arg1[0] == '<')
@ -301,7 +303,7 @@ error:
*/ */
void DetectUrilenFree(void *ptr) void DetectUrilenFree(void *ptr)
{ {
if (ptr != NULL) if (ptr == NULL)
return; return;
DetectUrilenData *urilend = (DetectUrilenData *)ptr; DetectUrilenData *urilend = (DetectUrilenData *)ptr;

Loading…
Cancel
Save