From b65ed8fa9b24709284a310328f97633df80f58ee Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Dec 2021 21:53:46 +0300 Subject: [PATCH] mountmgr.sys: Avoid use after free in dhcp4_config_request(). Signed-off-by: Paul Gofman Signed-off-by: Alexandre Julliard --- dlls/mountmgr.sys/dbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mountmgr.sys/dbus.c b/dlls/mountmgr.sys/dbus.c index 28b229f03d0..581d45e7702 100644 --- a/dlls/mountmgr.sys/dbus.c +++ b/dlls/mountmgr.sys/dbus.c @@ -635,11 +635,15 @@ static DBusMessage *dhcp4_config_request( const char *iface ) p_dbus_message_iter_init( reply, &iter ); if (p_dbus_message_iter_get_arg_type( &iter ) == DBUS_TYPE_OBJECT_PATH) p_dbus_message_iter_get_basic( &iter, &path ); - p_dbus_message_unref( reply ); - if (!path) return NULL; + if (!path) + { + p_dbus_message_unref( reply ); + return NULL; + } request = p_dbus_message_new_method_call( "org.freedesktop.NetworkManager", path, "org.freedesktop.DBus.Properties", "Get" ); + p_dbus_message_unref( reply ); if (!request) return NULL; p_dbus_message_iter_init_append( request, &iter );