Use XDG_STATE_HOME for jackdbus logs#967
Use XDG_STATE_HOME for jackdbus logs#967keithbowes wants to merge 2 commits intojackaudio:developfrom
Conversation
dbus/jackdbus.c
Outdated
There was a problem hiding this comment.
Tabs are the wrong indentation style here. The whole file contains just a handful of tab-indented lines (which have been like that since 2008), all the rest is indented with 4 spaces. Now would be a good time to not replicate the exact original indentation for the changed lines, but instead to fix all of it. Please use 4 spaces for your changes,, and also fix the remaining old tab-indented lines in the function, there's like 5 of them.
dbus/jackdbus.c
Outdated
There was a problem hiding this comment.
This leaks memory and is problematic in general. A pointer from getenv() shouldn't be free() d, but pathname_cat() returns an allocated buffer pointer which definitely should. If you use a single pointer variable like this, you lose information about whether you need to call free() on it before returning.
That being said, none of the temporary allocations from pathname_cat() are ever freed. The whole thing seems to have been leaky since 2008.
…xdg_state_home variables
Fixes #402
In that bug, it's mentioned that Debian has an $XDG_STATE_HOME extension for that purpose. Well, it's been added to version 0.8 of the specification (8 May 2021) with the description:
It's been a part of the official specification for almost three years and other applications use it, so it should be safe to use it and not add unnecessary files and directories to $HOME.