mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
gnutls: Fix a memory leak.
This commit is contained in:
parent
3bb17fca04
commit
b30ba732ad
@ -1,5 +1,7 @@
|
|||||||
2012-04-01 Giuseppe Scrivano <gscrivano@gnu.org>
|
2012-04-01 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* gnutls.c (wgnutls_read_timeout): Ensure timer is freed.
|
||||||
|
|
||||||
* gnutls.c (wgnutls_read_timeout): Do not use timer if it is not
|
* gnutls.c (wgnutls_read_timeout): Do not use timer if it is not
|
||||||
allocated.
|
allocated.
|
||||||
Reported by: Xu Zhongxing <xu_zhong_xing@163.com>
|
Reported by: Xu Zhongxing <xu_zhong_xing@163.com>
|
||||||
|
21
src/gnutls.c
21
src/gnutls.c
@ -175,15 +175,13 @@ wgnutls_read_timeout (int fd, char *buf, int bufsize, void *arg, double timeout)
|
|||||||
if (timeout)
|
if (timeout)
|
||||||
{
|
{
|
||||||
#ifdef F_GETFL
|
#ifdef F_GETFL
|
||||||
ret = fcntl (fd, F_SETFL, flags | O_NONBLOCK);
|
if (fcntl (fd, F_SETFL, flags | O_NONBLOCK))
|
||||||
if (ret < 0)
|
break;
|
||||||
return ret;
|
|
||||||
#else
|
#else
|
||||||
/* XXX: Assume it was blocking before. */
|
/* XXX: Assume it was blocking before. */
|
||||||
const int one = 1;
|
const int one = 1;
|
||||||
ret = ioctl (fd, FIONBIO, &one);
|
if (ioctl (fd, FIONBIO, &one) < 0)
|
||||||
if (ret < 0)
|
break;
|
||||||
return ret;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,16 +189,13 @@ wgnutls_read_timeout (int fd, char *buf, int bufsize, void *arg, double timeout)
|
|||||||
|
|
||||||
if (timeout)
|
if (timeout)
|
||||||
{
|
{
|
||||||
int status;
|
|
||||||
#ifdef F_GETFL
|
#ifdef F_GETFL
|
||||||
status = fcntl (fd, F_SETFL, flags);
|
if (fcntl (fd, F_SETFL, flags) < 0)
|
||||||
if (status < 0)
|
break;
|
||||||
return status;
|
|
||||||
#else
|
#else
|
||||||
const int zero = 0;
|
const int zero = 0;
|
||||||
status = ioctl (fd, FIONBIO, &zero);
|
if (ioctl (fd, FIONBIO, &zero) < 0)
|
||||||
if (status < 0)
|
break;
|
||||||
return status;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user