[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qemu-nbd: Implement socket activation.
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2] qemu-nbd: Implement socket activation. |
Date: |
Sat, 04 Feb 2017 10:58:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
"Richard W.M. Jones" <address@hidden> writes:
> On Fri, Feb 03, 2017 at 03:16:43PM +0000, Stefan Hajnoczi wrote:
>> On Thu, Feb 02, 2017 at 05:16:25PM +0000, Richard W.M. Jones wrote:
>> > + if (*port == NULL) {
>> > + *port = g_strdup_printf("%d", NBD_DEFAULT_PORT);;
>>
>> Please stringify NBD_DEFAULT_PORT instead of using g_strdup_printf().
>> That avoids the memory leak.
>
> Oops.
>
> Do we have a macro for this already? I couldn't see one, and the
> best I could come up with is:
>
> #define MACRO_EXPAND_STRINGIFY(x) STRINGIFY(x)
> #define STRINGIFY(x) #x
Check out stringify() in compiler.h.
(Yes, lower-case macros that don't behave like functions are bad style)
[...]