standards/153756: fp leak in hesiod.c .

Henning Petersen henning.petersen at t-online.de
Fri Jan 7 10:30:10 UTC 2011


>Number:         153756
>Category:       standards
>Synopsis:       fp leak in hesiod.c .
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 07 10:30:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Henning Petersen
>Release:        FreeBSD-current
>Organization:
>Environment:
>Description:
fp leak in hesiod.c .
>How-To-Repeat:

>Fix:
diff -u -r1.9 hesiod.c
--- lib/libc/net/hesiod.c	1 May 2003 19:03:14 -0000	1.9
+++ lib/libc/net/hesiod.c	5 Jan 2011 11:03:35 -0000
@@ -325,6 +325,7 @@
 			*which = strdup(data);
 			if (!*which) {
 				errno = ENOMEM;
+				fclose(fp);
 				return -1;
 			}
 		} else {


Patch attached with submission follows:

diff -u -r1.9 hesiod.c
--- lib/libc/net/hesiod.c	1 May 2003 19:03:14 -0000	1.9
+++ lib/libc/net/hesiod.c	5 Jan 2011 11:03:35 -0000
@@ -325,6 +325,7 @@
 			*which = strdup(data);
 			if (!*which) {
 				errno = ENOMEM;
+				fclose(fp);
 				return -1;
 			}
 		} else {


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-standards mailing list