On 1/8/26 10:28, Daniel P. Berrangé wrote:
> On Thu, Jan 08, 2026 at 09:47:39AM +0100, Michal Prívozník via Devel wrote:
>> On 1/7/26 15:13, Philipp Schuster wrote:
>>> This was triggered in my experiments with the `virsh net-*` command
>>> family.
>>>
>>> On-behalf-of: SAP [email protected]
>>> Signed-off-by: Philipp Schuster <[email protected]>
>>> ---
>>>  src/network/leaseshelper.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c
>>> index e1c0e81828..6383e08c1d 100644
>>> --- a/src/network/leaseshelper.c
>>> +++ b/src/network/leaseshelper.c
>>> @@ -83,7 +83,7 @@ main(int argc, char **argv)
>>>      g_autofree char *custom_lease_file = NULL;
>>>      const char *ip = NULL;
>>>      const char *mac = NULL;
>>> -    const char *leases_str = NULL;
>>> +    g_autofree const char *leases_str = NULL;
>>
>> Since it's dynamically allocated it's not 'const' really :-)
> 
> We should probably add a syntax-check rule to complain about
> "g_auto*" used at same time as "const" as that's conceptually
> flawed.

Except, g_autofree const char **arr  is okay. But if the regex is
written well then sure, let's add a syntax-check rule.

Michal

Reply via email to