[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-3.1 2/4] slirp: Use g_new() to allocate sock
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCH for-3.1 2/4] slirp: Use g_new() to allocate sockets in socreate() |
Date: |
Wed, 7 Nov 2018 00:07:27 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Peter Maydell, le mar. 06 nov. 2018 15:13:21 +0000, a ecrit:
> The slirp socreate() function can only fail if the attempt
> to malloc() the struct socket fails. Switch to using
> g_new() instead, which will allow us to remove the
> error-handling code from its callers.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> We already use g_new/g_malloc in slirp, including for
> mbuf buffers which are larger than these socket structs.
> The motivation here is that we can render moot a Coverity
> complaint about an issue in an error-handling path.
>
> As usual, indenting in slirp code is a bit of a mess;
> I've opted for "keep checkpatch happy".
Applied, thanks!
Samuel