print: remove leak in ek_check_protocolfilter().
Small rework while here to prevent the creation of str_escaped if the input string is enough for the check. Bug: 15758 Change-Id: I5facf0307d1e0fed882bbe3ef91463164cf3440c Reviewed-on: https://code.wireshark.org/review/33100 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
parent
8f85a1430d
commit
bc4ffefdad
|
@ -1103,8 +1103,12 @@ static gboolean
|
|||
ek_check_protocolfilter(gchar **protocolfilter, const char *str)
|
||||
{
|
||||
gchar *str_escaped = NULL;
|
||||
gboolean check;
|
||||
int i;
|
||||
|
||||
if (check_protocolfilter(protocolfilter, str))
|
||||
return TRUE;
|
||||
|
||||
/* to to thread the '.' and '_' equally. The '.' is replace by print_escaped_ek for '_' */
|
||||
if (str != NULL && strlen(str) > 0) {
|
||||
str_escaped = g_strdup(str);
|
||||
|
@ -1118,8 +1122,9 @@ ek_check_protocolfilter(gchar **protocolfilter, const char *str)
|
|||
}
|
||||
}
|
||||
|
||||
return check_protocolfilter(protocolfilter, str)
|
||||
|| check_protocolfilter(protocolfilter, str_escaped);
|
||||
check = check_protocolfilter(protocolfilter, str_escaped);
|
||||
g_free(str_escaped);
|
||||
return check;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue