Browse code

libclamav/mspack/cabd.c: fix possible description leak

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@995 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/10/14 03:24:02
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Oct 13 20:21:26 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/mspack/cabd.c: fix possible description leak
4
+
1 5
 Wed Oct 13 11:19:03 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/untar.c:	Added handling of some extra file types within the
... ...
@@ -283,6 +283,10 @@ static void cabd_close(struct mscab_decompressor *base,
283 283
   struct mscabd_file *fi, *nfi;
284 284
   struct mspack_system *sys;
285 285
 
286
+
287
+  if(origcab->desc)
288
+      close(origcab->desc);
289
+
286 290
   if (!base) return;
287 291
   sys = this->system;
288 292
 
... ...
@@ -217,7 +217,7 @@ static void *msp_alloc(struct mspack_system *this, size_t bytes) {
217 217
   *((size_t *)buf) = bytes;
218 218
   return &buf[8];
219 219
 #else
220
-  return malloc(bytes);
220
+  return cli_calloc(bytes, 1);
221 221
 #endif
222 222
 }
223 223