Re: [PATCH 4/7] libvirt_nss: Use automatic memory freeing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 22, 2025 at 14:25:14 +0200, Michal Privoznik via Devel wrote:
> From: Michal Privoznik <mprivozn@xxxxxxxxxx>
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tools/nss/libvirt_nss.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)

IIRC the nss plugin was meant to be kept free of both the libvirt
library and glib as it's actually linked into the address space of other
processes.

> 
> diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c
> index 25e2ec0642..8460b63228 100644
> --- a/tools/nss/libvirt_nss.c
> +++ b/tools/nss/libvirt_nss.c
> @@ -134,7 +134,7 @@ findLease(const char *name,
>  
>      DEBUG("Dir: %s", leaseDir);
>      while ((entry = readdir(dir)) != NULL) {
> -        char *path;
> +        g_autofree char *path = NULL;

So while we're okay using __attribute__(cleanup) I don't think we can
use glib here.



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux