Commit in reactos/lib/cabinet on MAIN
fdi.c+26-141.2 -> 1.3
- Don't try to free pointer from union that isn't used.

reactos/lib/cabinet
fdi.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- fdi.c	19 Sep 2004 09:18:36 -0000	1.2
+++ fdi.c	11 Dec 2004 00:33:13 -0000	1.3
@@ -2696,13 +2696,19 @@
   }
 
   /* free decompression temps */
-  if (LZX(window)) {
-    PFDI_FREE(hfdi, LZX(window));
-    LZX(window) = NULL;
-  }
-  if (QTM(window)) {
-    PFDI_FREE(hfdi, QTM(window));
-    QTM(window) = NULL;
+  switch (fol->comp_type & cffoldCOMPTYPE_MASK) {
+  case cffoldCOMPTYPE_LZX:
+    if (LZX(window)) {
+      PFDI_FREE(hfdi, LZX(window));
+      LZX(window) = NULL;
+    }
+    break;
+  case cffoldCOMPTYPE_QUANTUM:
+    if (QTM(window)) {
+      PFDI_FREE(hfdi, QTM(window));
+      QTM(window) = NULL;
+    }
+    break;
   }
 
   while (decomp_state) {
@@ -2738,13 +2744,19 @@
   bail_and_fail: /* here we free ram before error returns */
 
   /* free decompression temps */
-  if (LZX(window)) {
-    PFDI_FREE(hfdi, LZX(window));
-    LZX(window) = NULL;
-  }
-  if (QTM(window)) {
-    PFDI_FREE(hfdi, QTM(window));
-    QTM(window) = NULL;
+  switch (fol->comp_type & cffoldCOMPTYPE_MASK) {
+  case cffoldCOMPTYPE_LZX:
+    if (LZX(window)) {
+      PFDI_FREE(hfdi, LZX(window));
+      LZX(window) = NULL;
+    }
+    break;
+  case cffoldCOMPTYPE_QUANTUM:
+    if (QTM(window)) {
+      PFDI_FREE(hfdi, QTM(window));
+      QTM(window) = NULL;
+    }
+    break;
   }
 
   while (decomp_state) {
CVSspam 0.2.8