From nobody Mon Feb 9 01:16:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1615654176; cv=none; d=zohomail.com; s=zohoarc; b=U/hlMacmyirP9cjdsNQyJcYmsOIQvHA1r5Nu8oRH32hWZX6D7GFUxwjZVk4xPHCExbJCPfngFWAi3fvmfSaQekRLwGNhxcNltWvSQYLdwbim7X0F5mDwDRGjqW/4tf3AuvS4MXmhzo5L5PrVCPigpOQXQMnsEMm7LKT/RhdYtNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615654176; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mktypJvu/1F6oyY228R0OtNNmqjKKSzXTpTB6Y2kEiY=; b=b6Z46HhntkADYGqB2ZAZLTUH8UtApfBW2X2ShtdxTKKNp2NttbFlkvRFYRfp9mJtzSFPnbAbSlYPnSncjW2MPtyQkVMNUFatdHuNB21oGli/PJ4vk5xi7mVvkbBeQbJQsJKR23s5kPdGhWrMIOIb5wW1u9kbGmr2U1NxpUOPTNg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615654176774155.77655840657076; Sat, 13 Mar 2021 08:49:36 -0800 (PST) Received: from localhost ([::1]:46064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL7SJ-00037Y-Hl for importer@patchew.org; Sat, 13 Mar 2021 11:49:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL7HR-0002cw-Ti for qemu-devel@nongnu.org; Sat, 13 Mar 2021 11:38:21 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:44163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lL7HN-0007NW-BT for qemu-devel@nongnu.org; Sat, 13 Mar 2021 11:38:21 -0500 Received: by mail-wr1-x42b.google.com with SMTP id o14so2647721wrm.11 for ; Sat, 13 Mar 2021 08:38:16 -0800 (PST) Received: from localhost.localdomain ([197.61.164.30]) by smtp.googlemail.com with ESMTPSA id n6sm13173441wrt.1.2021.03.13.08.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 08:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mktypJvu/1F6oyY228R0OtNNmqjKKSzXTpTB6Y2kEiY=; b=LRVezUWwkD//9War1RbONH8jWzRpq2xti47gZZX1R26CxwHolq8xlM9v6Jbt/2J2uI 8nSFTFGtmcdLlgFkh5cakh5qqnRTl+wWQwfYUkqxqKlBkgXgZgsKs65D/dfp3R+UDSsL rbmCLbONtmtDzeqiCTF6RFgtZOVxIXEpaSoeBr+whP+vjfD5hGixz+snsLPGxEJ8PLxo U1TLvPGd4nDZikY2sv/C6L++PS7TIwhfFMFNjXvSP7+aeRhC/ev+Tr596K0mIz3zrqya MAKvbKR5jSs6pFOa58TXPKP9Nznlo6Y0ZZi3NaNOcFGZP0LZyYWC41ECdtt8olsRljC7 GZcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mktypJvu/1F6oyY228R0OtNNmqjKKSzXTpTB6Y2kEiY=; b=G+gxSYMpvmuCns67iYitkr4wl58J8IwFgZnpWr3kTBhbwpNdHKNWchrYIQwNtXRALV eZoMjhxJIm2BPbVl9tR7KNcfMbTTS9b8m9NmomkRDEJFVZBzvVzoM0HxKpobEVi+iy00 rR+4KNRMCJfoO0LXHEu5b+x8rCbxvmPs6AcYThdX/OlP7sIG/NGkgQm3dQU2wfcYfH2Q H7SMDoujk4d3y4dtOFmZa8cEYQCrSX8kOpGyFkko8a+RhWS5z1XNPlL3ePHeTHj8XbSF BYXWaYnyq3rbIe6y6HcIx4wSd13cwoAqVwB2v09mr4NBBcHO0AxmFhCTvH3jIOhm72QW BuXg== X-Gm-Message-State: AOAM532TMF7/AS5Kb9puHMrMGLbSoTC3uvqqzLHWS3U9s1wQPJNzcNK9 3qq8RFXf4eThsfJgWCQUh1+EYsN/guQ= X-Google-Smtp-Source: ABdhPJx5noi/B54EU76sZt0MYK0Zu1w6LhvOAtqG+DRe/kO7D6Q4PtxdIbbSony2EYOfLZcWHyl7kg== X-Received: by 2002:a5d:6684:: with SMTP id l4mr19570945wru.381.1615653494995; Sat, 13 Mar 2021 08:38:14 -0800 (PST) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 9/9] tools/virtiofsd: Replacing malloc-like calls with GLib's variants Date: Sat, 13 Mar 2021 18:36:53 +0200 Message-Id: <20210313163653.37089-10-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210313163653.37089-1-ma.mandourr@gmail.com> References: <20210313163653.37089-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , "Dr. David Alan Gilbert" , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" Changed calls to malloc(), calloc(), and realloc() with their equivalent allocation functions in GLib, and replaced their respective free() calls with g_free(). Allocation and deallocation of fuse_req structs, fuse_pollhandle structs, fuse_session structs and many local variables are now established through GLib's functions. Signed-off-by: Mahmoud Mandour --- tools/virtiofsd/fuse_lowlevel.c | 30 ++++++++++++++-------------- tools/virtiofsd/fuse_virtio.c | 34 ++++++++++++++++---------------- tools/virtiofsd/passthrough_ll.c | 32 +++++++++++++++--------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowleve= l.c index 1aa26c6333..5e188f8d8f 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -106,7 +106,7 @@ static void list_add_req(struct fuse_req *req, struct f= use_req *next) static void destroy_req(fuse_req_t req) { pthread_mutex_destroy(&req->lock); - free(req); + g_free(req); } =20 void fuse_free_req(fuse_req_t req) @@ -130,7 +130,7 @@ static struct fuse_req *fuse_ll_alloc_req(struct fuse_s= ession *se) { struct fuse_req *req; =20 - req =3D (struct fuse_req *)calloc(1, sizeof(struct fuse_req)); + req =3D g_try_new(struct fuse_req, 1); if (req =3D=3D NULL) { fuse_log(FUSE_LOG_ERR, "fuse: failed to allocate request\n"); } else { @@ -219,7 +219,7 @@ int fuse_reply_iov(fuse_req_t req, const struct iovec *= iov, int count) int res; struct iovec *padded_iov; =20 - padded_iov =3D malloc((count + 1) * sizeof(struct iovec)); + padded_iov =3D g_try_new(struct iovec, count + 1); if (padded_iov =3D=3D NULL) { return fuse_reply_err(req, ENOMEM); } @@ -228,7 +228,7 @@ int fuse_reply_iov(fuse_req_t req, const struct iovec *= iov, int count) count++; =20 res =3D send_reply_iov(req, 0, padded_iov, count); - free(padded_iov); + g_free(padded_iov); =20 return res; } @@ -568,7 +568,7 @@ static struct fuse_ioctl_iovec *fuse_ioctl_iovec_copy(c= onst struct iovec *iov, struct fuse_ioctl_iovec *fiov; size_t i; =20 - fiov =3D malloc(sizeof(fiov[0]) * count); + fiov =3D g_try_new(struct fuse_ioctl_iovec, count); if (!fiov) { return NULL; } @@ -629,8 +629,8 @@ int fuse_reply_ioctl_retry(fuse_req_t req, const struct= iovec *in_iov, =20 res =3D send_reply_iov(req, 0, iov, count); out: - free(in_fiov); - free(out_fiov); + g_free(in_fiov); + g_free(out_fiov); =20 return res; =20 @@ -667,7 +667,7 @@ int fuse_reply_ioctl_iov(fuse_req_t req, int result, co= nst struct iovec *iov, struct fuse_ioctl_out arg; int res; =20 - padded_iov =3D malloc((count + 2) * sizeof(struct iovec)); + padded_iov =3D g_try_new(struct iovec, count + 2); if (padded_iov =3D=3D NULL) { return fuse_reply_err(req, ENOMEM); } @@ -680,7 +680,7 @@ int fuse_reply_ioctl_iov(fuse_req_t req, int result, co= nst struct iovec *iov, memcpy(&padded_iov[2], iov, count * sizeof(struct iovec)); =20 res =3D send_reply_iov(req, 0, padded_iov, count + 2); - free(padded_iov); + g_free(padded_iov); =20 return res; } @@ -1684,7 +1684,7 @@ static struct fuse_req *check_interrupt(struct fuse_s= ession *se, if (curr->u.i.unique =3D=3D req->unique) { req->interrupted =3D 1; list_del_req(curr); - free(curr); + g_free(curr); return NULL; } } @@ -1760,7 +1760,7 @@ static void do_ioctl(fuse_req_t req, fuse_ino_t nodei= d, =20 void fuse_pollhandle_destroy(struct fuse_pollhandle *ph) { - free(ph); + g_free(ph); } =20 static void do_poll(fuse_req_t req, fuse_ino_t nodeid, @@ -1783,7 +1783,7 @@ static void do_poll(fuse_req_t req, fuse_ino_t nodeid, struct fuse_pollhandle *ph =3D NULL; =20 if (arg->flags & FUSE_POLL_SCHEDULE_NOTIFY) { - ph =3D malloc(sizeof(struct fuse_pollhandle)); + ph =3D g_try_new(struct fuse_pollhandle, 1); if (ph =3D=3D NULL) { fuse_reply_err(req, ENOMEM); return; @@ -2476,7 +2476,7 @@ void fuse_session_destroy(struct fuse_session *se) free(se->vu_socket_path); se->vu_socket_path =3D NULL; =20 - free(se); + g_free(se); } =20 =20 @@ -2499,7 +2499,7 @@ struct fuse_session *fuse_session_new(struct fuse_arg= s *args, return NULL; } =20 - se =3D (struct fuse_session *)calloc(1, sizeof(struct fuse_session)); + se =3D g_try_new0(struct fuse_session, 1); if (se =3D=3D NULL) { fuse_log(FUSE_LOG_ERR, "fuse: failed to allocate fuse object\n"); goto out1; @@ -2559,7 +2559,7 @@ struct fuse_session *fuse_session_new(struct fuse_arg= s *args, out4: fuse_opt_free_args(args); out2: - free(se); + g_free(se); out1: return NULL; } diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 523ee64fb7..598c97db1f 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -347,7 +347,7 @@ int virtio_send_data_iov(struct fuse_session *se, struc= t fuse_chan *ch, * Build a copy of the the in_sg iov so we can skip bits in it, * including changing the offsets */ - struct iovec *in_sg_cpy =3D calloc(sizeof(struct iovec), in_num); + struct iovec *in_sg_cpy =3D g_try_new0(struct iovec, in_num); assert(in_sg_cpy); memcpy(in_sg_cpy, in_sg, sizeof(struct iovec) * in_num); /* These get updated as we skip */ @@ -386,7 +386,7 @@ int virtio_send_data_iov(struct fuse_session *se, struc= t fuse_chan *ch, ret =3D errno; fuse_log(FUSE_LOG_DEBUG, "%s: preadv failed (%m) len=3D%zd\n", __func__, len); - free(in_sg_cpy); + g_free(in_sg_cpy); goto err; } fuse_log(FUSE_LOG_DEBUG, "%s: preadv ret=3D%d len=3D%zd\n", __func= __, @@ -410,13 +410,13 @@ int virtio_send_data_iov(struct fuse_session *se, str= uct fuse_chan *ch, if (ret !=3D len) { fuse_log(FUSE_LOG_DEBUG, "%s: ret!=3Dlen\n", __func__); ret =3D EIO; - free(in_sg_cpy); + g_free(in_sg_cpy); goto err; } in_sg_left -=3D ret; len -=3D ret; } while (in_sg_left); - free(in_sg_cpy); + g_free(in_sg_cpy); =20 /* Need to fix out->len on EOF */ if (len) { @@ -476,7 +476,7 @@ static void fv_queue_worker(gpointer data, gpointer use= r_data) * They're spread over multiple descriptors in a scatter/gather set * and we can't trust the guest to keep them still; so copy in/out. */ - fbuf.mem =3D malloc(se->bufsize); + fbuf.mem =3D g_try_malloc(se->bufsize); assert(fbuf.mem); =20 fuse_mutex_init(&req->ch.lock); @@ -528,10 +528,10 @@ static void fv_queue_worker(gpointer data, gpointer u= ser_data) fbuf.size =3D out_sg[0].iov_len + out_sg[1].iov_len; =20 /* Allocate the bufv, with space for the rest of the iov */ - pbufv =3D malloc(sizeof(struct fuse_bufvec) + + pbufv =3D g_try_malloc(sizeof(struct fuse_bufvec) + sizeof(struct fuse_buf) * (out_num - 2)); if (!pbufv) { - fuse_log(FUSE_LOG_ERR, "%s: pbufv malloc failed\n", + fuse_log(FUSE_LOG_ERR, "%s: pbufv g_try_malloc failed\n", __func__); goto out; } @@ -573,7 +573,7 @@ static void fv_queue_worker(gpointer data, gpointer use= r_data) =20 out: if (allocated_bufv) { - free(pbufv); + g_free(pbufv); } =20 /* If the request has no reply, still recycle the virtqueue element */ @@ -592,8 +592,8 @@ out: } =20 pthread_mutex_destroy(&req->ch.lock); - free(fbuf.mem); - free(req); + g_free(fbuf.mem); + g_free(req); } =20 /* Thread function for individual queues, created when a queue is 'started= ' */ @@ -733,7 +733,7 @@ static void fv_queue_cleanup_thread(struct fv_VuDev *vu= d, int qidx) pthread_mutex_destroy(&ourqi->vq_lock); close(ourqi->kill_fd); ourqi->kick_fd =3D -1; - free(vud->qi[qidx]); + g_free(vud->qi[qidx]); vud->qi[qidx] =3D NULL; } =20 @@ -764,14 +764,14 @@ static void fv_queue_set_started(VuDev *dev, int qidx= , bool started) if (started) { /* Fire up a thread to watch this queue */ if (qidx >=3D vud->nqueues) { - vud->qi =3D realloc(vud->qi, (qidx + 1) * sizeof(vud->qi[0])); + vud->qi =3D g_try_realloc_n(vud->qi, (qidx + 1), sizeof(vud->q= i[0])); assert(vud->qi); memset(vud->qi + vud->nqueues, 0, sizeof(vud->qi[0]) * (1 + (qidx - vud->nqueues))); vud->nqueues =3D qidx + 1; } if (!vud->qi[qidx]) { - vud->qi[qidx] =3D calloc(sizeof(struct fv_QueueInfo), 1); + vud->qi[qidx] =3D g_try_new0(struct fv_QueueInfo, 1); assert(vud->qi[qidx]); vud->qi[qidx]->virtio_dev =3D vud; vud->qi[qidx]->qidx =3D qidx; @@ -1032,9 +1032,9 @@ int virtio_session_mount(struct fuse_session *se) __func__); =20 /* TODO: Some cleanup/deallocation! */ - se->virtio_dev =3D calloc(sizeof(struct fv_VuDev), 1); + se->virtio_dev =3D g_try_new0(struct fv_VuDev, 1); if (!se->virtio_dev) { - fuse_log(FUSE_LOG_ERR, "%s: virtio_dev calloc failed\n", __func__); + fuse_log(FUSE_LOG_ERR, "%s: virtio_dev g_try_new0 failed\n", __fun= c__); close(data_sock); return -1; } @@ -1059,8 +1059,8 @@ void virtio_session_close(struct fuse_session *se) return; } =20 - free(se->virtio_dev->qi); + g_free(se->virtio_dev->qi); pthread_rwlock_destroy(&se->virtio_dev->vu_dispatch_rwlock); - free(se->virtio_dev); + g_free(se->virtio_dev); se->virtio_dev =3D NULL; } diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index fc7e1b1e8e..5c475a30af 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -399,7 +399,7 @@ static void lo_map_init(struct lo_map *map) =20 static void lo_map_destroy(struct lo_map *map) { - free(map->elems); + g_free(map->elems); } =20 static int lo_map_grow(struct lo_map *map, size_t new_nelems) @@ -411,7 +411,7 @@ static int lo_map_grow(struct lo_map *map, size_t new_n= elems) return 1; } =20 - new_elems =3D realloc(map->elems, sizeof(map->elems[0]) * new_nelems); + new_elems =3D g_realloc_n(map->elems, new_nelems, sizeof(map->elems[0]= )); if (!new_elems) { return 0; } @@ -549,7 +549,7 @@ static void lo_inode_put(struct lo_data *lo, struct lo_= inode **inodep) =20 if (g_atomic_int_dec_and_test(&inode->refcount)) { close(inode->fd); - free(inode); + g_free(inode); } } =20 @@ -904,7 +904,7 @@ static void posix_locks_value_destroy(gpointer data) * closing this fd should release all OFD locks. */ close(plock->fd); - free(plock); + g_free(plock); } =20 static int do_statx(struct lo_data *lo, int dirfd, const char *pathname, @@ -1020,7 +1020,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t pa= rent, const char *name, if (inode) { close(newfd); } else { - inode =3D calloc(1, sizeof(struct lo_inode)); + inode =3D g_try_new0(struct lo_inode, 1); if (!inode) { goto out_err; } @@ -1532,7 +1532,7 @@ static void lo_dirp_put(struct lo_dirp **dp) =20 if (g_atomic_int_dec_and_test(&d->refcount)) { closedir(d->dp); - free(d); + g_free(d); } } =20 @@ -1564,7 +1564,7 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino, int fd; ssize_t fh; =20 - d =3D calloc(1, sizeof(struct lo_dirp)); + d =3D g_try_new0(struct lo_dirp, 1); if (d =3D=3D NULL) { goto out_err; } @@ -1606,7 +1606,7 @@ out_err: } else if (fd !=3D -1) { close(fd); } - free(d); + g_free(d); } fuse_reply_err(req, error); } @@ -1633,7 +1633,7 @@ static void lo_do_readdir(fuse_req_t req, fuse_ino_t = ino, size_t size, } =20 err =3D ENOMEM; - buf =3D calloc(1, size); + buf =3D g_try_malloc0(size); if (!buf) { goto error; } @@ -1719,7 +1719,7 @@ error: } else { fuse_reply_buf(req, buf, size - rem); } - free(buf); + g_free(buf); } =20 static void lo_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, @@ -1943,7 +1943,7 @@ static struct lo_inode_plock *lookup_create_plock_ctx= (struct lo_data *lo, return plock; } =20 - plock =3D malloc(sizeof(struct lo_inode_plock)); + plock =3D g_try_new(struct lo_inode_plock, 1); if (!plock) { *err =3D ENOMEM; return NULL; @@ -1954,7 +1954,7 @@ static struct lo_inode_plock *lookup_create_plock_ctx= (struct lo_data *lo, fd =3D lo_inode_open(lo, inode, O_RDWR); if (fd < 0) { *err =3D -fd; - free(plock); + g_free(plock); return NULL; } =20 @@ -2731,7 +2731,7 @@ static void lo_getxattr(fuse_req_t req, fuse_ino_t in= o, const char *in_name, ino, name, size); =20 if (size) { - value =3D malloc(size); + value =3D g_try_malloc(size); if (!value) { goto out_err; } @@ -2770,7 +2770,7 @@ static void lo_getxattr(fuse_req_t req, fuse_ino_t in= o, const char *in_name, fuse_reply_xattr(req, ret); } out_free: - free(value); + g_free(value); =20 if (fd >=3D 0) { close(fd); @@ -2812,7 +2812,7 @@ static void lo_listxattr(fuse_req_t req, fuse_ino_t i= no, size_t size) size); =20 if (size) { - value =3D malloc(size); + value =3D g_try_malloc(size); if (!value) { goto out_err; } @@ -2897,7 +2897,7 @@ static void lo_listxattr(fuse_req_t req, fuse_ino_t i= no, size_t size) fuse_reply_xattr(req, ret); } out_free: - free(value); + g_free(value); =20 if (fd >=3D 0) { close(fd); --=20 2.25.1