]> granicus.if.org Git - gc/commitdiff
Fix double multiplication of lb by n in calloc_explicitly_typed
authorIvan Maidanski <ivmai@mail.ru>
Thu, 15 Sep 2016 06:47:23 +0000 (09:47 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 31 Oct 2016 20:35:02 +0000 (23:35 +0300)
* typd_mlc.c (GC_calloc_explicitly_typed): Do not multiply lb by n
twice (when passed to GC_malloc in case of
GC_general_register_disappearing_link fails).

typd_mlc.c

index 839c3144f9a26b02988671f57b1397ba358faf71..b7688b06babea9e10d441834222461989e77dc99 100644 (file)
@@ -682,7 +682,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_calloc_explicitly_typed(size_t n,
            /* Couldn't register it due to lack of memory.  Punt.        */
            /* This will probably fail too, but gives the recovery code  */
            /* a chance.                                                 */
-           return(GC_malloc(n*lb));
+            return GC_malloc(lb);
        }
    }
    return op;