summaryrefslogtreecommitdiff
path: root/src/xsmfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xsmfns.c')
-rw-r--r--src/xsmfns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c
index d3b4d4d66a3..fb0d01bb66c 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -16,7 +16,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
@@ -401,12 +401,14 @@ x_session_initialize (struct x_display_info *dpyinfo)
ptrdiff_t name_len = 0;
/* libSM seems to crash if pwd is missing - see bug#18851. */
- if (! emacs_get_current_dir_name ())
+ char *pwd = emacs_get_current_dir_name ();
+ if (!pwd)
{
fprintf (stderr, "Disabling session management due to pwd error: %s\n",
emacs_strerror (errno));
return;
}
+ xfree (pwd);
ice_fd = -1;
doing_interact = false;