[PATCH] obexd: fix small probability problem

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

 



Need to consider the case where err is not released
---
 gobex/gobex.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index e9b89cead..bc4d52551 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -1140,8 +1140,12 @@ static void handle_response(GObex *obex, GError *err, GObexPacket *rsp)
 		p->rsp_func(obex, err, rsp, p->rsp_data);
 
 		/* Check if user callback removed the request */
-		if (!final_rsp && p != obex->pending_req)
+		if (!final_rsp && p != obex->pending_req) {
+			if (p->cancelled)
+				g_error_free(err);
+
 			return;
+		}
 	}
 
 	if (p->cancelled)
-- 
2.20.1






[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux