From 9ca184f1e81afa9b68d799ecaae4a16e09684e39 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 20 Jan 2007 15:42:57 +0000 Subject: Check for memory allocation errors of the key file --- hcid/dbus-service.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hcid') diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index f1e3d05f..2c449c6e 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -792,6 +792,11 @@ static struct service *create_service(const char *file) } keyfile = g_key_file_new(); + if (!keyfile) { + error("OOM while allocating key file"); + service_free(service); + return NULL; + } if (!g_key_file_load_from_file(keyfile, file, 0, &err)) { error("Parsing %s failed: %s", file, err->message); -- cgit