- try to free all memory we allocated

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@465 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2002-04-05 14:55:37 +00:00
parent 93ee58e07e
commit 65d82412cb
1 changed files with 21 additions and 1 deletions

View File

@ -276,7 +276,27 @@ whine: if (profile->cbs)
void
sc_profile_free(struct sc_profile *profile)
{
/* XXX Needs to be done. Huge memory leak */
struct file_info *fi;
struct auth_info *ai;
struct pin_info *pi;
while ((fi = profile->ef_list) != NULL) {
profile->ef_list = fi->next;
sc_file_free(fi->file);
free(fi->ident);
free(fi);
}
while ((ai = profile->auth_list) != NULL) {
profile->auth_list = ai->next;
free(ai);
}
while ((pi = profile->pin_list) != NULL) {
profile->pin_list = pi->next;
free(pi);
}
free(profile);
}