[PATCH] libhal: do not dereference *reason_why_locked if it's NULL
Guillem Jover
guillem.jover at nokia.com
Thu Nov 8 19:07:30 PST 2007
---
libhal/libhal.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libhal/libhal.c b/libhal/libhal.c
index dfdbcce..6c1480c 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -2274,6 +2274,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.5
More information about the hal
mailing list