slirp/misc: Use the GLib memory allocation APIs
commit2fd5d864099dd38b43b595e9e3375dad2f76049b
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Tue, 19 Aug 2014 08:30:17 +0000 (19 16:30 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 24 Aug 2014 09:16:32 +0000 (24 13:16 +0400)
tree3ad0abcf5c4c34314e36096f96b7537fcee39e63
parent58ab9e680731ffd1793a7957ab8523f1dca18d05
slirp/misc: Use the GLib memory allocation APIs

Here we don't check the return value of malloc() which may fail.
Use the g_new() instead, which will abort the program when
there is not enough memory.

Also, use g_strdup instead of strdup and remove the unnecessary
strdup function.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
slirp/misc.c
slirp/misc.h
slirp/slirp_config.h