[117632] trunk/base/src/cregistry/file.c

raimue at macports.org raimue at macports.org
Thu Mar 6 03:28:16 PST 2014


Revision: 117632
          https://trac.macports.org/changeset/117632
Author:   raimue at macports.org
Date:     2014-03-06 03:28:16 -0800 (Thu, 06 Mar 2014)
Log Message:
-----------
cregistry: Fix error reported by scan-build

Result of 'malloc' is converted to a pointer of type 'reg_file *', which is incompatible with sizeof operand type 'void *'

Modified Paths:
--------------
    trunk/base/src/cregistry/file.c

Modified: trunk/base/src/cregistry/file.c
===================================================================
--- trunk/base/src/cregistry/file.c	2014-03-06 11:19:34 UTC (rev 117631)
+++ trunk/base/src/cregistry/file.c	2014-03-06 11:28:16 UTC (rev 117632)
@@ -336,7 +336,7 @@
     int file_space = 10;
     Tcl_HashEntry* hash;
     Tcl_HashSearch search;
-    *files = malloc(10 * sizeof(void*));
+    *files = malloc(file_space * sizeof(reg_file*));
     if (!*files) {
         return -1;
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140306/06fc7058/attachment.html>


More information about the macports-changes mailing list