Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed keyring-related memory leaks #2

Merged
merged 1 commit into from
Nov 7, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ void keyring_free(keyring_file *k)

/* Wipe everything, just to be sure. */
bzero(k,sizeof(keyring_file));

free(k);

return;
}
Expand All @@ -207,6 +209,7 @@ void keyring_free_context(keyring_context *c)
}
if (c->KeyRingSalt) {
bzero(c->KeyRingSalt,c->KeyRingSaltLen);
free(c->KeyRingSalt);
c->KeyRingSalt=NULL;
c->KeyRingSaltLen=0;
}
Expand All @@ -217,6 +220,8 @@ void keyring_free_context(keyring_context *c)

/* Make sure any private data is wiped out */
bzero(c,sizeof(keyring_context));

free(c);

return;
}
Expand Down Expand Up @@ -246,6 +251,9 @@ void keyring_free_identity(keyring_identity *id)
}

bzero(id,sizeof(keyring_identity));

free(id);

return;
}

Expand All @@ -263,6 +271,9 @@ void keyring_free_keypair(keypair *kp)
}

bzero(kp,sizeof(keypair));

free(kp);

return;
}

Expand Down