summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-07-08 20:19:07 +0300
committerraveit65 <[email protected]>2017-07-10 18:43:50 +0200
commitbcae77484b45bdc6dc1bc5f9d98595264a1785d1 (patch)
tree536182780e699b09a0981fc98b8070378625770f /stickynotes/stickynotes.c
parenta57972f035d7a9541ed54d34ca666b01ebb37d8f (diff)
downloadmate-applets-bcae77484b45bdc6dc1bc5f9d98595264a1785d1.tar.bz2
mate-applets-bcae77484b45bdc6dc1bc5f9d98595264a1785d1.tar.xz
stickynotes: reword previous commit a bit and don't leak dir name
similar to how it's done in https://git.gnome.org/browse/gnome-applets/commit/?id=cbadc03ed7fe432bbbe37932c2c81d7d5181fe15
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r--stickynotes/stickynotes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 3f1256a4..10428620 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -779,8 +779,10 @@ stickynotes_save_now (void)
/* The XML file is $HOME/.config/mate/stickynotes-applet, most probably */
{
- gchar* file = g_build_filename(g_get_user_config_dir(), "mate", "stickynotes-applet.xml", NULL);
- g_mkdir_with_parents(g_path_get_dirname(file), S_IRWXU);
+ gchar* path = g_build_filename(g_get_user_config_dir(), "mate", NULL);
+ gchar* file = g_build_filename(path, "stickynotes-applet.xml", NULL);
+ g_mkdir_with_parents(path, S_IRWXU);
+ g_free(path);
xmlSaveFormatFile(file, doc, 1);