[glib-networking/wip/pwithnall/dtls: 9/18] gnutls: Fix a potential release of a non-allocated FD
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/wip/pwithnall/dtls: 9/18] gnutls: Fix a potential release of a non-allocated FD
- Date: Tue, 1 Sep 2015 14:28:08 +0000 (UTC)
commit cf31077551ccbe7967f8fbc5c7bb72af377cbf5d
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Jul 3 18:52:57 2015 +0100
gnutls: Fix a potential release of a non-allocated FD
If the initial allocation of the poll FD for this cancellable fails,
there is no FD to release, so don’t try.
https://bugzilla.gnome.org/show_bug.cgi?id=697908
tls/gnutls/gtlsconnection-gnutls.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index aa0eae7..8d47594 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -667,8 +667,11 @@ claim_op (GTlsConnectionGnutls *gnutls,
nfds = 2;
else
nfds = 1;
+
g_poll (fds, nfds, -1);
- g_cancellable_release_fd (cancellable);
+
+ if (nfds > 1)
+ g_cancellable_release_fd (cancellable);
goto try_again;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]