From eef16eec0391c495d0d3753a974b410b40fc34fd Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 12 Jul 2018 13:32:10 +0100 Subject: [PATCH 11/18] nonce: Don't try to rmdir(NULL) on OOM If re-initializing the string fails, it will be left in a state where it has a length of 0 and a NULL buffer. That's valid to "free", but not valid to pass to rmdir(). Signed-off-by: Simon McVittie --- dbus/dbus-nonce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c index b56116b3..ef5eb617 100644 --- a/dbus/dbus-nonce.c +++ b/dbus/dbus-nonce.c @@ -383,7 +383,7 @@ do_noncefile_create (DBusNonceFile **noncefile_out, return TRUE; on_error: - if (use_subdir) + if (use_subdir && _dbus_string_get_length (&noncefile->dir) != 0) _dbus_delete_directory (&noncefile->dir, NULL); _dbus_string_free (&noncefile->dir); _dbus_string_free (&noncefile->path); -- 2.18.0