Convert malloc()/ calloc() calls to g_malloc()/ g_try_malloc()/ g_new0()
All heap memory allocation should go through glib so that we can take
advantage of a single memory allocator and its debugging/tracing features.
Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
---
v1->v2 convert the free() call in host_to_target_semarray()
to g_free() and calls g_try_malloc(count) instead of
g_try_malloc(sizeof(count))
v2->v3 used g_try_new() and friends to avoid overflow issues
v3->v4 use g_free for unlock_iovec() and host_to_target_semarray().
v4->v5 one missing malloc() is converted and one converted is fixed.