]> git.proxmox.com Git - spiceterm.git/commit
fix memory leaks when using g_hashtable
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 26 May 2017 12:28:12 +0000 (14:28 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 2 Jun 2017 08:49:41 +0000 (10:49 +0200)
commitade67faf797d0e055e512c78a0da4eba7650416f
tree06d413c255888ada599ab632b44c61a3b7c1e234
parent5eeef146edda84ed0ed2d3965dce2dc6d6221cf9
fix memory leaks when using g_hashtable

when generating a bitmap for a character whose codepoint was above 255,
we used a cache_id of 0, malloc'd a CachedImage and inserted it into a
g_hashtable, without freeing the one which was before inserted with cache_id 0

this is circumvented by only generating a CachedImage when having
a cache_id != 0

the second leak was also with inserting into a hashtable, but there we
give the hashtable the g_free method as a value_destroy_func

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
input.c
screen.c