diff options
| author | Simeon Simeonov | 2018-04-13 09:40:58 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2018-04-13 09:40:58 +0200 |
| commit | 42772c59f490d54d9766e1853daa35c08298f985 (patch) | |
| tree | 8d0e1a249ed9fa69ff147b8320847209a42882c7 | |
| parent | c3bb560dc0e86fc427872e6cf304323aa7a84c4d (diff) | |
Make it possible to unload the master password several times
| -rw-r--r-- | libsylph/masterpassword.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libsylph/masterpassword.c b/libsylph/masterpassword.c index 2da6969..950b79a 100644 --- a/libsylph/masterpassword.c +++ b/libsylph/masterpassword.c | |||
| @@ -48,6 +48,10 @@ void cleanse_buffer(void *buf, size_t len) { | |||
| 48 | 48 | ||
| 49 | void unload_master_password(void) { | 49 | void unload_master_password(void) { |
| 50 | 50 | ||
| 51 | if (master_password == NULL) { | ||
| 52 | /* not loaded / already unloaded */ | ||
| 53 | return; | ||
| 54 | } | ||
| 51 | cleanse_buffer(master_password, strlen(master_password)); | 55 | cleanse_buffer(master_password, strlen(master_password)); |
| 52 | g_free(master_password); | 56 | g_free(master_password); |
| 53 | master_password = NULL; | 57 | master_password = NULL; |
