mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 15:53:12 +02:00
core: free secured data on exit
This commit is contained in:
@@ -1336,3 +1336,27 @@ secure_buffer_open ()
|
||||
|
||||
secure_buffer_display ();
|
||||
}
|
||||
|
||||
/*
|
||||
* Frees all allocated data.
|
||||
*/
|
||||
|
||||
void
|
||||
secure_end ()
|
||||
{
|
||||
if (secure_passphrase)
|
||||
{
|
||||
free (secure_passphrase);
|
||||
secure_passphrase = NULL;
|
||||
}
|
||||
if (secure_hashtable_data)
|
||||
{
|
||||
hashtable_free (secure_hashtable_data);
|
||||
secure_hashtable_data = NULL;
|
||||
}
|
||||
if (secure_hashtable_data_encrypted)
|
||||
{
|
||||
hashtable_free (secure_hashtable_data_encrypted);
|
||||
secure_hashtable_data_encrypted = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,5 +66,6 @@ extern void secure_free ();
|
||||
extern void secure_buffer_display ();
|
||||
extern void secure_buffer_assign ();
|
||||
extern void secure_buffer_open ();
|
||||
extern void secure_end ();
|
||||
|
||||
#endif /* __WEECHAT_SECURE_H */
|
||||
|
||||
@@ -490,6 +490,7 @@ main (int argc, char *argv[])
|
||||
unhook_all (); /* remove all hooks */
|
||||
hdata_end (); /* end hdata */
|
||||
eval_end (); /* end eval */
|
||||
secure_end (); /* end secured data */
|
||||
string_end (); /* end string */
|
||||
weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user