Don't se_leak expert_info records.

se_alloc them where and if  needed, not every time expert_set_info_vformat is called.


svn path=/trunk/; revision=17293
This commit is contained in:
Luis Ontanon 2006-02-13 23:20:38 +00:00
parent a086a018dc
commit 8e121c003c
2 changed files with 8 additions and 6 deletions

View File

@ -86,12 +86,12 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
if ((ret == -1) || (ret >= sizeof(formatted)))
formatted[sizeof(formatted) - 1] = '\0';
ei = se_alloc(sizeof(expert_info_t));
ei = ep_alloc(sizeof(expert_info_t));
ei->packet_num = pinfo ? pinfo->fd->num : 0;
ei->group = group;
ei->severity = severity;
ei->protocol = se_strdup(pinfo->current_proto);
ei->summary = se_strdup(formatted);
ei->protocol = ep_strdup(pinfo->current_proto);
ei->summary = ep_strdup(formatted);
ei->pitem = NULL;
/* if we have a proto_item (not a faked item), set expert attributes to it */

View File

@ -137,10 +137,12 @@ void expert_dlg_reset(void *tapdata)
int expert_dlg_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pointer)
{
expert_info_t *ei = (expert_info_t *) pointer;
expert_info_t *ei = se_memdup(pointer,sizeof(expert_info_t));
expert_tapdata_t * etd = tapdata;
ei->protocol = se_strdup(ei->protocol);
ei->summary = se_strdup(ei->summary);
switch(ei->severity) {
case(PI_CHAT):
etd->chat_events++;