fixed keyring-related memory leaks

This commit is contained in:
Dan Staples 2013-10-31 21:42:37 -04:00 committed by Jeremy Lakeman
parent b3ad074666
commit f1d817463e

View File

@ -223,7 +223,8 @@ void keyring_free(keyring_file *k)
/* Wipe everything, just to be sure. */ /* Wipe everything, just to be sure. */
bzero(k,sizeof(keyring_file)); bzero(k,sizeof(keyring_file));
free(k);
return; return;
} }
@ -272,6 +273,7 @@ static void keyring_free_context(keyring_context *c)
} }
if (c->KeyRingSalt) { if (c->KeyRingSalt) {
bzero(c->KeyRingSalt,c->KeyRingSaltLen); bzero(c->KeyRingSalt,c->KeyRingSaltLen);
free(c->KeyRingSalt);
c->KeyRingSalt = NULL; c->KeyRingSalt = NULL;
c->KeyRingSaltLen = 0; c->KeyRingSaltLen = 0;
} }