hostmem-file: plug a small leak

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXERcyAAoJEDhwtADrkYZTvIAQAJ1Yd+VIcjT1o/pDFOhDqUGu
 PasrTq2S8jeFrseN/5t+BAnOCNOkMXlzhSwYZKlycJ41eWyfgIb6+Jkg/H3QHd2o
 WLRMpzKnDT2gnQBeb2ht9WAk+6EmfLLKegxSvDKuLecJ0vfyoz5+m4Bem+AP5yqE
 yeDNdenKzO82u2D0tol1s4Mb0iX8AGG7xBuC+SFEIgBznibNUAcz/kNFvV2CECzy
 M2fvElj70Eza0FqpLM/lY9fpfNGtsctRIr/p/P4ijZY/dSWTXzy/0DEaDV0BI94J
 oxI35FKZUB1vXx1xU38UAp5v1Yhg9bH2LcaGwV8nwqLIjx6UqckbWXd5SKFZrWO9
 WcXFm+BudwvZ0hUpuuOg9SabvaWpgG6631PekkMYdIMz/OiSmI6DvY86iZBX4viR
 cM4LFw+JfYwO6kocE+Xw0Yd0Y/wIrMNoLJ9sm0C9uofSxUvrwc/Iglzgbzj939fl
 MLIwLwe5Bced7Ucw6GJ+Upp5GBv7yJJSa9q2UJ+NTh1pwZX1z3F/wEv1VE7pArtz
 SBhB7/hfPZkiJv0Yg5WREvQTkw09v4iYso6KvEEx0D5GJngBfOhZDizK5PN9NyKS
 WH+fWDIP0daHRc9V526kdsbpEcdsJjGdwNhkVM6M0AepyCKeAgAg5M7RRRIG7YS7
 +ek93fqd9oKMV6rGGMMj
 =seHo
 -----END PGP SIGNATURE-----

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: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2016-04-15 17:43:34 +01:00
commit c7b45f1282
1 changed files with 8 additions and 0 deletions

View File

@ -121,11 +121,19 @@ file_backend_instance_init(Object *o)
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 = {
.name = TYPE_MEMORY_BACKEND_FILE,
.parent = TYPE_MEMORY_BACKEND,
.class_init = file_backend_class_init,
.instance_init = file_backend_instance_init,
.instance_finalize = file_backend_instance_finalize,
.instance_size = sizeof(HostMemoryBackendFile),
};