From d3feafb48b8016d8a5450d629789da42309ea33c Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 8 Nov 2015 14:46:00 +0100 Subject: [PATCH 1/2] Fix memory leak in _dbus_win_set_error_from_win_error() with zero error parameter. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 --- dbus/dbus-sysdeps-win.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index e626cc6..b7b967d 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -3602,6 +3602,9 @@ _dbus_win_set_error_from_win_error (DBusError *error, { char *msg; + if (!error) + return; + /* As we want the English message, use the A API */ FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | -- 1.8.4.5