]> 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:54:41 +0000 (10:54 +0200)
commitffeedb040b00aaad00e5309baa20c086deeb0d83
treeb7b23b727706cf7aca09702a31d0e74f576f2a12
parent377a4ee926bab9aeada2117e3a35b8658fa4e958
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