From: Pavel Hrdina Date: Wed, 8 Apr 2026 14:02:41 +0000 (+0200) Subject: chSocketRecv: Fix memory leak X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74e619c8ce6b446e4a76fbc4f2de488706034f24;p=thirdparty%2Flibvirt.git chSocketRecv: Fix memory leak Add missing g_autofree as the code looks like it was already written to use it. Fixes: 6316f26cd2dbb506569ac5b757dd36a5dd38088a Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 29db853a7f..a67274b4a5 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -548,7 +548,7 @@ static char * chSocketRecv(int sock, bool use_timeout) { struct pollfd pfds[1]; - char *buf = NULL; + g_autofree char *buf = NULL; size_t buf_len = 1024; int timeout = PKT_TIMEOUT_MS; int ret;