public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Ismagil Iskakov <i.iskakov@omp.ru>
To: <linux-bluetooth@vger.kernel.org>
Cc: Ismagil Iskakov <i.iskakov@omp.ru>
Subject: [PATCH BlueZ 1/1] obexd/client: prevent double freeing
Date: Mon, 7 Jul 2025 17:52:42 +0300	[thread overview]
Message-ID: <20250707145242.2356210-2-i.iskakov@omp.ru> (raw)
In-Reply-To: <20250707145242.2356210-1-i.iskakov@omp.ru>

image_properties_complete_cb frees 'contents' after a failure.
However obc_transfer_get_contents does it beforehand.
---
 obexd/client/transfer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 668cefa40..a7d00896f 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -971,6 +971,7 @@ int obc_transfer_get_contents(struct obc_transfer *transfer, char **contents,
 	if (ret < 0) {
 		error("read(): %s(%d)", strerror(errno), errno);
 		g_free(*contents);
+		*contents = NULL;
 		return -errno;
 	}
 
-- 
2.34.1


  reply	other threads:[~2025-07-07 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 14:52 [PATCH BlueZ 0/1] Fix double free in obexd/client Ismagil Iskakov
2025-07-07 14:52 ` Ismagil Iskakov [this message]
2025-07-07 16:33   ` bluez.test.bot
2025-07-07 18:10 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250707145242.2356210-2-i.iskakov@omp.ru \
    --to=i.iskakov@omp.ru \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox