diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-01-20 15:42:57 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-01-20 15:42:57 +0000 |
commit | 9ca184f1e81afa9b68d799ecaae4a16e09684e39 (patch) | |
tree | 077eff8af4ec26e1bf6529617d658e5adcef001f /hcid | |
parent | 287567b16f625b10227ff6fe803939e3208b9a9c (diff) |
Check for memory allocation errors of the key file
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-service.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |