Revision: 41014
http://brlcad.svn.sourceforge.net/brlcad/?rev=41014&view=rev
Author: r_weiss
Date: 2010-10-16 02:57:22 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
In function bu_realloc added check to insure the minimum amount of memory is
allocated to store a pointer. This change is consistent with function _bu_alloc.
Modified Paths:
--------------
brlcad/trunk/src/libbu/malloc.c
Modified: brlcad/trunk/src/libbu/malloc.c
===================================================================
--- brlcad/trunk/src/libbu/malloc.c 2010-10-16 02:49:48 UTC (rev 41013)
+++ brlcad/trunk/src/libbu/malloc.c 2010-10-16 02:57:22 UTC (rev 41014)
@@ -357,7 +357,12 @@
{
struct memdebug *mp=NULL;
genptr_t original_ptr;
+ const size_t MINSIZE = sizeof(uint32_t) > sizeof(intptr_t) ?
sizeof(uint32_t) : sizeof(intptr_t);
+ if (cnt < MINSIZE) {
+ cnt = MINSIZE;
+ }
+
if (!ptr) {
/* This is so we are compatible with system realloc. It seems
* like an odd behaviour, but some non-BRL-CAD code relies on
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits