From 5f3678c9a50ffbcda1cbe2b9bb16e8665c13a68f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 20 Nov 2007 14:50:43 +0100 Subject: [PATCH] libhal: do not dereference *reason_why_locked if it's NULL Do not dereference *reason_why_locked if it's NULL after call dbus_malloc0(). --- libhal/libhal.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libhal/libhal.c b/libhal/libhal.c index 619b7a5..2697239 100644 --- a/libhal/libhal.c +++ b/libhal/libhal.c @@ -2279,6 +2279,8 @@ libhal_device_lock (LibHalContext *ctx, if (reason_why_locked != NULL) { *reason_why_locked = dbus_malloc0 (strlen (error->message) + 1); + if (*reason_why_locked == NULL) + return FALSE; strcpy (*reason_why_locked, error->message); } } -- 1.5.3.7