diff options
| author | zhanghailiang | 2014-08-19 10:30:17 +0200 |
|---|---|---|
| committer | Michael Tokarev | 2014-08-24 11:16:32 +0200 |
| commit | 2fd5d864099dd38b43b595e9e3375dad2f76049b (patch) | |
| tree | 3ad0abcf5c4c34314e36096f96b7537fcee39e63 /slirp/misc.h | |
| parent | configure: no need to mkdir QMP (diff) | |
| download | qemu-2fd5d864099dd38b43b595e9e3375dad2f76049b.tar.gz qemu-2fd5d864099dd38b43b595e9e3375dad2f76049b.tar.xz qemu-2fd5d864099dd38b43b595e9e3375dad2f76049b.zip | |
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>
Diffstat (limited to 'slirp/misc.h')
| -rw-r--r-- | slirp/misc.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/slirp/misc.h b/slirp/misc.h index ba8beb1b17..41a32583da 100644 --- a/slirp/misc.h +++ b/slirp/misc.h @@ -16,10 +16,6 @@ struct ex_list { struct ex_list *ex_next; }; -#ifndef HAVE_STRDUP -char *strdup(const char *); -#endif - #define EMU_NONE 0x0 /* TCP emulations */ |
