summaryrefslogtreecommitdiff
path: root/gobex
diff options
context:
space:
mode:
authorTedd Ho-Jeong An <tedd.an@intel.com>2022-02-18 11:46:17 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-02-18 13:25:57 -0800
commit8fe1e5e165ad7b4f7c318f507aa85cd747401b81 (patch)
tree9ef7fe044b20ea86ef57b42673685f11a76a8155 /gobex
parent51c34da9d693fe12d7c940f7224e830e41d8f1dd (diff)
downloadbluez-8fe1e5e165ad7b4f7c318f507aa85cd747401b81.tar.gz
gobex: Fix read from pointer after free
This patch sets the pointer to null after free since the g_free(p) doesn't set the pointer to NULL. This is reported by the Coverity. Fixes: 7e7d826aa1db ("gobex: Print error if data cannot be written")
Diffstat (limited to 'gobex')
-rw-r--r--gobex/gobex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gobex/gobex.c b/gobex/gobex.c
index 185eed4d7..e9b89cead 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -471,6 +471,8 @@ encode:
check_srm_final(obex,
obex->tx_buf[0] & ~FINAL_BIT);
pending_pkt_free(p);
+ /* g_free() doesn't set the pointer to NULL */
+ p = NULL;
}
obex->tx_data = len;