changeset 6324:1076012c37f5

Cleanup file resources properly in TimeZone_md.
author andrew
date Mon, 09 Sep 2013 20:18:12 +0100
parents 424d6404dab6
children 6e44e8962a31
files src/solaris/native/java/util/TimeZone_md.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/util/TimeZone_md.c	Fri Sep 06 21:36:31 2013 +0100
+++ b/src/solaris/native/java/util/TimeZone_md.c	Mon Sep 09 20:18:12 2013 +0100
@@ -250,6 +250,7 @@
             }
         }
         (void) fclose(fp);
+	fp = NULL;
         if (tz != NULL) {
             return tz;
         }
@@ -306,12 +307,15 @@
 		    tz = strdup(p);
 		    break; 
 		}
-		(void) fclose(fp);
-		if (tz != NULL) {
-		    return tz;
-		}
 	    }
 	}
+	if (fp != NULL) {
+	    (void) fclose(fp);
+	    fp = NULL;
+	}
+	if (tz != NULL) {
+	    return tz;
+	}
     }
 
     /*