diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-10-07 20:55:38 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-10-07 20:57:24 +0900 |
commit | 1a6cf2f1282e4acc6999eff23e828c2009dbdd04 (patch) | |
tree | 2532eb8c6b034f79a8a65c7f0dd0716abb8d0fd4 /windows.c | |
parent | b4c11a7ed3806c7ac30666676ffe5640d6c07bca (diff) | |
download | subsurface-1a6cf2f1282e4acc6999eff23e828c2009dbdd04.tar.gz |
Fix potential crash when attempting to free default font
Before setting a new font we try to free the existing font. Sadly if no
config value is set for the default font, we assign a string literal.
Which of course means that subsurface dumps core when trying to free it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r-- | windows.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -155,7 +155,7 @@ void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar, GtkWidget *vbox, GtkUIManager *ui_manager) { if (!divelist_font) - divelist_font = DIVELIST_DEFAULT_FONT; + divelist_font = strdup(DIVELIST_DEFAULT_FONT); gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); } |