Commit 294e8b0b authored by Simon McVittie's avatar Simon McVittie

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's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
parent b274bc13
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment