Commit 0d7f089f authored by 's avatar
Browse files

fixed many memory leaks in trackflib library.


git-svn-id: file:///home/svn/mapi/trunk@930 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 3520d46f
......@@ -416,7 +416,18 @@ static int dc_cleanup(mapidflib_function_instance_t *instance)
temp = temp->next;
free(tmp);
}
free(((struct mapid_dc*)instance->internal_data)->dclist[i]);
}
#ifndef __WITH_AHO__
for(i=0;i<STRING_NUM;i++) {
free(((struct mapid_dc*)instance->internal_data)->shift[i]);
free(((struct mapid_dc*)instance->internal_data)->skip[i]);
}
#else
acsmFree2(((struct mapid_dc*)instance->internal_data)->acsm);
#endif
free(((struct mapid_dc*)instance->internal_data)->dclist);
free(instance->internal_data);
}
......
......@@ -533,7 +533,11 @@ static int edonkey_cleanup(mapidflib_function_instance_t *instance)
temp = temp->next;
free(tmp);
}
free(((struct mapid_edonkey*)instance->internal_data)->edonkeylist[i]);
}
free(((struct mapid_edonkey*)instance->internal_data)->shift[0]);
free(((struct mapid_edonkey*)instance->internal_data)->skip[0]);
free(((struct mapid_edonkey*)instance->internal_data)->edonkeylist);
free(instance->internal_data);
......
......@@ -379,7 +379,16 @@ static int gnutella_cleanup(mapidflib_function_instance_t *instance)
temp = temp->next;
free(tmp);
}
free(((struct mapid_gnutella*)instance->internal_data)->gnulist[i]);
}
#ifndef __WITH_AHO__
for(i=0;i<GNUTELLA_STRING_NO;i++) {
free(((struct mapid_gnutella*)instance->internal_data)->shift[i]);
free(((struct mapid_gnutella*)instance->internal_data)->skip[i]);
}
#else
acsmFree2(((struct mapid_gnutella*)instance->internal_data)->acsm);
#endif
free(((struct mapid_gnutella*)instance->internal_data)->gnulist);
free(instance->internal_data);
......
......@@ -455,11 +455,18 @@ static int torrent_cleanup(mapidflib_function_instance_t *instance)
temp = temp->next;
free(tmp);
}
free(((struct mapid_torrent*)instance->internal_data)->torlist[i]);
}
#ifndef __WITH_AHO__
for(i=0;i<TOR_STRINGS_NO;i++) {
free(((struct mapid_torrent*)instance->internal_data)->shift[i]);
free(((struct mapid_torrent*)instance->internal_data)->skip[i]);
}
#else
acsmFree2(((struct mapid_torrent*)instance->internal_data)->acsm);
#endif
free(((struct mapid_torrent*)instance->internal_data)->torlist);
free(instance->internal_data);
}
......
......@@ -329,6 +329,7 @@ static int trackftp_cleanup(mapidflib_function_instance_t *instance)
free(tmp);
}
free(((struct mapid_ftp*)instance->internal_data)->ftplist[i]);
temp = ((struct mapid_ftp*)instance->internal_data)->cntlist[i]->head;
......@@ -337,6 +338,8 @@ static int trackftp_cleanup(mapidflib_function_instance_t *instance)
temp = temp->next;
free(tmp);
}
free(((struct mapid_ftp*)instance->internal_data)->cntlist[i]);
}
free(((struct mapid_ftp*)instance->internal_data)->ftplist);
free(((struct mapid_ftp*)instance->internal_data)->cntlist);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment