summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/settings.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/settings.c b/src/settings.c
index e756364..663a21a 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -63,13 +63,17 @@ void BarSettingsInit (BarSettings_t *settings) {
}
void BarSettingsDestroy (BarSettings_t *settings) {
- BarKeyShortcut_t *curShortcut, *lastShortcut;
+ BarKeyShortcut_t *curShortcut = settings->keys, *lastShortcut;
while (curShortcut != NULL) {
lastShortcut = curShortcut;
curShortcut = curShortcut->next;
- free (lastShortcut->description);
- free (lastShortcut->configKey);
+ if (lastShortcut->description != NULL) {
+ free (lastShortcut->description);
+ }
+ if (lastShortcut->configKey != NULL) {
+ free (lastShortcut->configKey);
+ }
free (lastShortcut);
}
free (settings->controlProxy);