From 8fbab8933fc4e0e87dbb263c9414dc349fc3cdb8 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 12 Mar 2020 15:01:26 +0100 Subject: [PATCH] utils: Fix use-after-free in xdp_get_app_info_from_pid() This was freeing the value before returning it. This was noticed by jhenstridge in https://github.com/flatpak/xdg-desktop-portal/pull/443 --- src/xdp-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdp-utils.c b/src/xdp-utils.c index 2f5be5c..4f72df1 100644 --- a/src/xdp-utils.c +++ b/src/xdp-utils.c @@ -618,7 +618,7 @@ xdp_get_app_info_from_pid (pid_t pid, if (app_info == NULL) app_info = xdp_app_info_new_host (); - return app_info; + return g_steal_pointer (&app_info); } static XdpAppInfo *