]> granicus.if.org Git - cracklib/commitdiff
also close wfp fd if it was opened
authorNathan Neulinger <nneul@neulinger.org>
Fri, 17 Feb 2006 19:43:00 +0000 (19:43 +0000)
committerNathan Neulinger <nneul@neulinger.org>
Fri, 17 Feb 2006 19:43:00 +0000 (19:43 +0000)
git-svn-id: file:///tmp/cracklib-svn/trunk@81 4175fe1e-86d5-4fdc-8e6a-506fab9d8533

cracklib/lib/packlib.c

index 0c9b52c6a8330863242af01d7d893709211bf797..0baab63128bb3d3b7fcfc21d09e6c3e5f59cc8f0 100644 (file)
@@ -125,6 +125,10 @@ PWOpen(prefix, mode)
            pdesc.header.pih_magic = 0;
            fclose(ifp);
            fclose(dfp);
+           if(wfp)
+           {
+               fclose(wfp);
+           }
            return ((PWDICT *) 0);
        }
 
@@ -139,6 +143,10 @@ PWOpen(prefix, mode)
                 pdesc.header.pih_magic = 0;
                 fclose(ifp);
                 fclose(dfp);
+               if(wfp)
+               {
+                       fclose(wfp);
+               }
                 return ((PWDICT *) 0);
             }
             if (pdesc64.header.pih_magic != PIH_MAGIC)
@@ -149,6 +157,10 @@ PWOpen(prefix, mode)
                 pdesc.header.pih_magic = 0;
                 fclose(ifp);
                 fclose(dfp);
+               if(wfp)
+               {
+                       fclose(wfp);
+               }
                 return ((PWDICT *) 0);
             }
             pdesc.header.pih_magic = pdesc64.header.pih_magic;
@@ -165,6 +177,10 @@ PWOpen(prefix, mode)
            pdesc.header.pih_magic = 0;
            fclose(ifp);
            fclose(dfp);
+           if(wfp)
+           {
+               fclose(wfp);
+           }
            return ((PWDICT *) 0);
        }
 
@@ -175,6 +191,10 @@ PWOpen(prefix, mode)
             pdesc.header.pih_magic = 0;
             fclose(ifp);
             fclose(dfp);
+           if(wfp)
+           {
+               fclose(wfp);
+           }
             return ((PWDICT *) 0);
         }
 
@@ -185,6 +205,10 @@ PWOpen(prefix, mode)
            pdesc.header.pih_magic = 0;
            fclose(ifp);
            fclose(dfp);
+           if(wfp)
+           {
+               fclose(wfp);
+           }
            return ((PWDICT *) 0);
        }
 
@@ -265,6 +289,10 @@ PWClose(pwp)
 
     fclose(pwp->ifp);
     fclose(pwp->dfp);
+    if(pwp->wfp)
+    {
+        fclose(pwp->wfp);
+    }
 
     pwp->header.pih_magic = 0;