summaryrefslogtreecommitdiffstats
path: root/subsurfacestartup.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-12-18 08:47:42 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-18 07:20:10 -0800
commitda154222cc659769770a625c17bf4162eb929f42 (patch)
treeff0072226b3d7e8b3772a25fa0bef657ffd245ca /subsurfacestartup.c
parentbe1b79081d078b55aad0e85016d3ef2cd4cbdeaf (diff)
downloadsubsurface-da154222cc659769770a625c17bf4162eb929f42.tar.gz
Free strduped prefs before exit
This plugs a leak detected by valgrind. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurfacestartup.c')
-rw-r--r--subsurfacestartup.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/subsurfacestartup.c b/subsurfacestartup.c
index 8847ab36a..618e942f3 100644
--- a/subsurfacestartup.c
+++ b/subsurfacestartup.c
@@ -219,3 +219,20 @@ void setup_system_prefs(void)
default_prefs.units = IMPERIAL_units;
}
+
+/*
+ * Free strduped prefs before exit.
+ *
+ * These are not real leaks but they plug the holes found by eg.
+ * valgrind so you can find the real leaks.
+ */
+void free_prefs(void)
+{
+ free((void*)prefs.default_filename);
+ free((void*)prefs.default_cylinder);
+ free((void*)prefs.divelist_font);
+ free(prefs.proxy_host);
+ free(prefs.proxy_user);
+ free(prefs.proxy_pass);
+ free(prefs.userid);
+}