aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2014-03-13 12:31:25 +0100
committerJon Lund Steffensen <jonlst@gmail.com>2014-03-13 12:31:25 +0100
commitf5da6bf71fa6935acc488169e5b6727ed9adb6ca (patch)
tree3fcc1b57e85fe1581f3143915ba25ca6ce5297d3 /src
parentFixes #38: Merge branch 'xdg-config-dirs' (diff)
parentFree resources from config-ini.c on exit (diff)
downloadredshift-ng-f5da6bf71fa6935acc488169e5b6727ed9adb6ca.tar.gz
redshift-ng-f5da6bf71fa6935acc488169e5b6727ed9adb6ca.tar.bz2
redshift-ng-f5da6bf71fa6935acc488169e5b6727ed9adb6ca.tar.xz
Merge remote-tracking branch 'maandree/leaks'
Diffstat (limited to 'src')
-rw-r--r--src/config-ini.c4
-rw-r--r--src/redshift.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/config-ini.c b/src/config-ini.c
index 75e7f7e..65751dd 100644
--- a/src/config-ini.c
+++ b/src/config-ini.c
@@ -268,15 +268,19 @@ config_ini_free(config_ini_state_t *state)
while (section != NULL) {
config_ini_setting_t *setting = section->settings;
+ config_ini_section_t *section_prev = section;
while (setting != NULL) {
+ config_ini_setting_t *setting_prev = setting;
free(setting->name);
free(setting->value);
setting = setting->next;
+ free(setting_prev);
}
free(section->name);
section = section->next;
+ free(section_prev);
}
}
diff --git a/src/redshift.c b/src/redshift.c
index af76e67..e4143fc 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -1089,6 +1089,8 @@ main(int argc, char *argv[])
}
}
+ config_ini_free(&config_state);
+
switch (mode) {
case PROGRAM_MODE_ONE_SHOT:
case PROGRAM_MODE_PRINT: