Marcus Meissner : cabinet: Fixed free_decompression_temps/_mem , handle NULL (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Oct 19 09:56:09 CDT 2009


Module: wine
Branch: master
Commit: 87118d00fee433eff377f81b5feb3dd9c7f85903
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=87118d00fee433eff377f81b5feb3dd9c7f85903

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sun Oct 18 21:31:59 2009 +0200

cabinet: Fixed free_decompression_temps/_mem , handle NULL (Coverity).

---

 dlls/cabinet/fdi.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 8132818..61dafdb 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -2279,9 +2279,10 @@ static void free_decompression_temps(HFDI hfdi, const struct fdi_folder *fol,
   }
 }
 
-static void free_decompression_mem(HFDI hfdi, struct fdi_folder *fol,
+static void free_decompression_mem(HFDI hfdi,
   fdi_decomp_state *decomp_state, struct fdi_file *file)
 {
+  struct fdi_folder *fol;
   while (decomp_state) {
     fdi_decomp_state *prev_fds;
 
@@ -2896,17 +2897,17 @@ BOOL __cdecl FDICopy(
   }
 
   free_decompression_temps(hfdi, fol, decomp_state);
-  free_decompression_mem(hfdi, fol, decomp_state, file);
+  free_decompression_mem(hfdi, decomp_state, file);
  
   return TRUE;
 
   bail_and_fail: /* here we free ram before error returns */
 
-  free_decompression_temps(hfdi, fol, decomp_state);
+  if (fol) free_decompression_temps(hfdi, fol, decomp_state);
 
   if (filehf) PFDI_CLOSE(hfdi, filehf);
 
-  free_decompression_mem(hfdi, fol, decomp_state, file);
+  free_decompression_mem(hfdi, decomp_state, file);
 
   return FALSE;
 }




More information about the wine-cvs mailing list