mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-16 00:34:39 +08:00
Check for memory allocation errors of the key file
This commit is contained in:
parent
287567b16f
commit
9ca184f1e8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user