[PATCH] Handle kit_strdup_printf failure.

Jim Meyering meyering at redhat.com
Tue Mar 4 02:12:48 PST 2008


* src/polkit-dbus/polkit-dbus.c (polkit_caller_new_from_pid):

Signed-off-by: Jim Meyering <meyering at redhat.com>
---
 src/polkit-dbus/polkit-dbus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/polkit-dbus/polkit-dbus.c b/src/polkit-dbus/polkit-dbus.c
index fc329d3..54cc7f5 100644
--- a/src/polkit-dbus/polkit-dbus.c
+++ b/src/polkit-dbus/polkit-dbus.c
@@ -643,7 +643,7 @@ polkit_caller_new_from_pid (DBusConnection *con, pid_t pid, DBusError *error)

         if (uid == (uid_t) -1) {
                 proc_path = kit_strdup_printf ("/proc/%d", pid);
-                if (stat (proc_path, &statbuf) != 0) {
+                if (proc_path && stat (proc_path, &statbuf) != 0) {
                         kit_warning ("Cannot lookup information for pid %d: %s", pid, strerror (errno));
                         goto out;
                 }
-- 
1.5.4.3.448.ga661


--=-=-=


--------------------------------------------------------------
Remove unnecessary strdup.
* src/polkit-grant/polkit-grant-helper-shadow.c (do_auth):

--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0002-Remove-unnecessary-strdup.patch



More information about the hal mailing list