gnutls-devel
[Top][All Lists]
Advanced

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

GnuTLS leaks a file descriptor in _gnutls_psk_pwd_find_entry()


From: Laurence Withers
Subject: GnuTLS leaks a file descriptor in _gnutls_psk_pwd_find_entry()
Date: Wed, 2 Apr 2008 18:15:36 +0000
User-agent: KMail/1.9.9

Hi,

I've found that GnuTLS leaks a file descriptor in 
_gnutls_psk_pwd_find_entry() (from src/lib/auth_psk_pwd.c) . On line 
175, we see a call to open a file:

  FILE* fd;
  /* ... */
  fd = fopen (cred->password_file, "r");

However, there is no associated call to fclose. The attached patch, 
against version 2.2.2, adds a call to fclose() in each of the possible 
exit paths.

I have tested it with the application in which I noticed the leak; the 
leak no longer occurs. The patch also applies cleanly against 2.3.4, 
although I did not perform a runtime test.

Bye for now,
-- 
Laurence Withers, <address@hidden>  --  jabber:address@hidden
http://www.lwithers.me.uk/                             tel:+447753988197

Attachment: gnutls-2.2.2-fix-fd-leak.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]