[PATCH] obexd: Fix obex pointer is not null judgment

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

 



Judge that the obex pointer is not null before
OBEX release
---
 gobex/gobex-transfer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c
index c94d018b2..77cbeefcf 100644
--- a/gobex/gobex-transfer.c
+++ b/gobex/gobex-transfer.c
@@ -63,8 +63,9 @@ static void transfer_free(struct transfer *transfer)
 	if (transfer->abort_id > 0)
 		g_obex_remove_request_function(transfer->obex,
 							transfer->abort_id);
+	if (transfer->obex)
+		g_obex_unref(transfer->obex);
 
-	g_obex_unref(transfer->obex);
 	g_free(transfer);
 }
 
-- 
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