Check for memory allocation errors of the key file

This commit is contained in:
Marcel Holtmann 2007-01-20 15:42:57 +00:00
parent 287567b16f
commit 9ca184f1e8

View File

@ -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);