提交 c7b45f12 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/armbru/tags/pull-backends-2016-04-15' into staging

hostmem-file: plug a small leak

# gpg: Signature made Fri 15 Apr 2016 17:30:42 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-backends-2016-04-15:
  hostmem-file: plug a small leak
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
...@@ -121,11 +121,19 @@ file_backend_instance_init(Object *o) ...@@ -121,11 +121,19 @@ file_backend_instance_init(Object *o)
set_mem_path, NULL); set_mem_path, NULL);
} }
static void file_backend_instance_finalize(Object *o)
{
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
g_free(fb->mem_path);
}
static const TypeInfo file_backend_info = { static const TypeInfo file_backend_info = {
.name = TYPE_MEMORY_BACKEND_FILE, .name = TYPE_MEMORY_BACKEND_FILE,
.parent = TYPE_MEMORY_BACKEND, .parent = TYPE_MEMORY_BACKEND,
.class_init = file_backend_class_init, .class_init = file_backend_class_init,
.instance_init = file_backend_instance_init, .instance_init = file_backend_instance_init,
.instance_finalize = file_backend_instance_finalize,
.instance_size = sizeof(HostMemoryBackendFile), .instance_size = sizeof(HostMemoryBackendFile),
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册